+
+
+
+
+
+
{lang board_message}
+
+ {lang db_export_tips}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/system/template/lyear/fileperms.htm b/admin/system/template/lyear/fileperms.htm
new file mode 100644
index 0000000..cd9f113
--- /dev/null
+++ b/admin/system/template/lyear/fileperms.htm
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+ 主要检查文件及文件夹的写入权限,点击下面按钮开始进行检查
+
+
+
+
+
+
+
+
正在进行文件权限检查,请稍候......
+
+
+
{lang message_redirect}
+
+
+
+
+
+
+ 如果某个文件或目录被检查到“无法写入”(以红色列出),请即刻通过 FTP 或其他工具修改其属性(例如设置为 777),以确保站点功能的正常使用。
+
+
+
+ $result
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/system/template/lyear/lyear_left.htm b/admin/system/template/lyear/lyear_left.htm
new file mode 100644
index 0000000..3a11615
--- /dev/null
+++ b/admin/system/template/lyear/lyear_left.htm
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/admin/system/template/lyear/updatecache.htm b/admin/system/template/lyear/updatecache.htm
new file mode 100644
index 0000000..d864258
--- /dev/null
+++ b/admin/system/template/lyear/updatecache.htm
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+ 1.{lang nav_updatecache_confirm}
+
+
+
+
+ 2.{lang nav_updatecache_verify}
+
+
+
+
+ 3.{lang nav_updatecache_completed}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{lang tools_updatecache_waiting}
+
+
+
+ {lang message_redirect}
+
+
+
+
{lang update_cache_succeed}
+
+
+
+
{lang board_message}
+
+ {lang tools_updatecache_tips}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/system/template/lyear/upgrade.htm b/admin/system/template/lyear/upgrade.htm
new file mode 100644
index 0000000..7c48b46
--- /dev/null
+++ b/admin/system/template/lyear/upgrade.htm
@@ -0,0 +1,234 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{lang upgrade_checking}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $value[title]
+ $value[btn1]
+
+ $value[official]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/system/template/lyear/upgrade_iframe.htm b/admin/system/template/lyear/upgrade_iframe.htm
new file mode 100644
index 0000000..ce32e73
--- /dev/null
+++ b/admin/system/template/lyear/upgrade_iframe.htm
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ $msg
+
+
+
+
\ No newline at end of file
diff --git a/admin/system/template/lyear/xtxx.htm b/admin/system/template/lyear/xtxx.htm
new file mode 100644
index 0000000..bc02328
--- /dev/null
+++ b/admin/system/template/lyear/xtxx.htm
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
已加载的扩展
+ $extensions
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/system/template/xtxx.htm b/admin/system/template/xtxx.htm
index fe9db66..5554534 100644
--- a/admin/system/template/xtxx.htm
+++ b/admin/system/template/xtxx.htm
@@ -100,7 +100,7 @@
-
已加载的扩展:
+
已加载的扩展:
$extensions
diff --git a/admin/system/updatecache.php b/admin/system/updatecache.php
index d15219b..153b100 100644
--- a/admin/system/updatecache.php
+++ b/admin/system/updatecache.php
@@ -9,22 +9,10 @@
if (!defined('IN_DZZ') || !defined('IN_ADMIN')) {
exit('Access Denied');
}
-
-$oparr = array('updatecache', 'database', /*'security','patch','update',*/
-'cron', 'log');
-$leftmenu = array();
-$op = $_GET['op'];
-foreach ($oparr as $key => $value) {
- $leftmenu[$value] = array('title' => lang($value), 'active' => '');
- if ($value == $op)
- $leftmenu[$value]['active'] = 'class="active"';
-}
-
include libfile('function/cache');
-
-$navtitle = lang('updatecache') . ' - ' . lang('admin_navtitle');
+$navtitle = lang('updatecache') . ' - ' . lang('appname');
$step = max(1, intval($_GET['step']));
-
+$op = isset($_GET['op']) ? $_GET['op'] : '';
if ($step == 1) {
} elseif ($step == 2) {
$type = implode('_', (array)$_GET['type']);
diff --git a/admin/system/xtxx.php b/admin/system/xtxx.php
index 2ae2467..f9bdea4 100644
--- a/admin/system/xtxx.php
+++ b/admin/system/xtxx.php
@@ -9,8 +9,8 @@
if (!defined('IN_DZZ') || !defined('IN_ADMIN')) {
exit('Access Denied');
}
-$op = $_GET['op'];
-$do=$_GET['do'];
+$op = isset($_GET['op']) ? $_GET['op'] : '';
+$do = isset($_GET['do']) ? $_GET['do'] : '';
if($do == 'phpinfo'){
exit(phpinfo());
}
@@ -125,15 +125,13 @@ function kuozhan(){
else $func_items = array('mysql_connect', 'file_get_contents', 'xml_parser_create','filesize', 'curl_init','zip_open','ffmpeg','imagick','imagemagick','cURL','date','Exif','Fileinfo','Ftp','GD','gettext','intl','Iconv','json','ldap','Mbstring','Mcrypt','Memcached','MySQLi','SQLite3','OpenSSL','PDO','pdo_mysql','pdo_sqlite','Redis','session','Sockets','Swoole','dom','xml','SimpleXML','libxml','bz2','zip','zlib');
foreach($func_items as $item) {
$status = function_exists($item);
- $func_str .= "
\n";
- $func_str .= "
$item \n";
+ $func_str .= "
$item\n";
if($status) {
- $func_str .= " \n";
- $func_str .= "
\n";
+ $func_str .= "
\n";
} else {
- $func_str .= "
\n";
- $func_str .= "
\n";
+ $func_str .= "
\n";
}
+ $func_str .= "
\n";
}
echo $func_str;
}
@@ -141,7 +139,7 @@ function kuozhan(){
$loaded_extensions = get_loaded_extensions();
$extensions = '';
foreach ($loaded_extensions as $key => $value) {
- $extensions .= '
'.$value . ' ';
+ $extensions .= '
'.$value . ' ';
}
$zaixianrenshu = DB::result_first("SELECT COUNT(*) FROM " . DB::table('session') . " WHERE uid");
$yonghurenshu = DB::result_first("SELECT COUNT(*) FROM " . DB::table('user') . " WHERE uid");
diff --git a/admin/systemlog/admin.php b/admin/systemlog/admin.php
index e34033f..7d6b001 100644
--- a/admin/systemlog/admin.php
+++ b/admin/systemlog/admin.php
@@ -2,7 +2,7 @@
//error_reporting(E_ALL);
if(!defined('IN_DZZ')) {
exit('Access Denied');
-}
+}
define('NOROBOT', TRUE);
$returntype = isset($_GET['returnType']) ? $_GET['returnType']: 'json';//返回值方式
diff --git a/admin/systemlog/classes/systemlog.php b/admin/systemlog/classes/systemlog.php
index d5ae785..efd9be7 100644
--- a/admin/systemlog/classes/systemlog.php
+++ b/admin/systemlog/classes/systemlog.php
@@ -51,7 +51,7 @@ class Systemlog{
$log = array($log);
}
$cur_url = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
- $from_url = $_SERVER['HTTP_REFERER'];
+ $from_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
foreach($log as $tmp) {
$tmp=implode("\t", clearlogstring(array($_G['timestamp'],$_G['username'], $_G['groupid'], $_G['clientip'],$tmp,$cur_url,$from_url,$_SERVER['HTTP_USER_AGENT'],"uid=".$_G['uid']))) ;
fwrite($fp, "\t".str_replace(array('', '?>'), '', $tmp)."\n");
diff --git a/admin/systemlog/index.php b/admin/systemlog/index.php
index fbefa1a..fee5ec6 100644
--- a/admin/systemlog/index.php
+++ b/admin/systemlog/index.php
@@ -1,30 +1,158 @@
$v){
+ $nowfilemaxnum=($jishu*($k+1))-($jishu-$firstlogsnum);
+ $startnum=($nowfilemaxnum-$jishu)<=0?0:($nowfilemaxnum-$jishu+1);
+ $newdata[]=array("file"=>$v,"start"=>$startnum,"end"=>$nowfilemaxnum);
+ }
+ //print_R($newdata);
+ //查询当前分页数据位于哪个日志文件
+ $lastlog=$last_secondlog="";
+ foreach($newdata as $k=>$v){
+ if( $start<=$v["end"]){
+ $lastlog=$v;
+ if( ($start+$limit)<$v["end"]){
+
+ }else{
+ if( isset($newdata[$k+1])){
+ $last_secondlog=$newdata[$k+1];
+ }
+ }
+ break;
+ }
+ }
+
+ $j=0;
+ for($i=$lastlog["start"];$i<$lastlog["end"];$i++){
+ if( $start<=($lastlog["start"]+$j) ){
+ break;
+ }
+ $j++;
+ }
+ //获取数据开始
+ $logs = file($logdir.$lastlog["file"]);
+ $logs = array_reverse($logs);
+ if($keyword){
+ foreach($logs as $key => $value) {
+ if(!empty($_GET['keyword']) && strpos($value, $_GET['keyword']) === FALSE) {
+ unset($logs[$key]);
+ }
+ }
+ $count = count($logs);
+ }
+ if( $lastlog["file"]!=$logfiles[0] ){
+ $j++;
+ }
+ $logs = array_slice($logs, $j, $limit);
+ $onecountget = count($logs);
+
+ $jj=0;
+ if( $last_secondlog ){
+ for($i=$last_secondlog["start"];$i<$last_secondlog["end"];$i++){
+ if( ($jj)>= ($limit-$onecountget)){
+ break;
+ }
+ $jj++;
+ }
+ }
+
+ if($last_secondlog){
+ $logs2 = file( $logdir.$last_secondlog["file"] );
+ $logs2 = array_reverse($logs2);
+ $end=$limit-count($logs);
+ $logs2 = array_slice( $logs2, 0, $jj);
+ $logs=array_merge($logs,$logs2);
+ }
+ if($logs) {
+ $usergroup = array();
+ foreach(C::t('usergroup')->range() as $group) {
+ $usergroup[$group['groupid']] = $group['grouptitle'];
+ }
+ $list=array();
+ $id = $start + 1;
+ foreach($logs as $logrow) {
+ $log = explode("\t", $logrow);
+ if(empty($log[1])) {
+ continue;
+ }
+ $log[1] = dgmdate($log[1], 'Y-n-j H:i:s');
+ $log[3] = $usergroup[$log[3]];
+ $list[] = [
+ "id" => $id++,
+ "operator" => $log[2],
+ "usergroup" => $log[3],
+ "ip" => $log[4],
+ "time" => $log[1],
+ "loginfo" => $log[5],
+ "visit" => $log[6],
+ "from" => $log[7],
+ "info" => $log[8],
+ ];
+ }
+ }
+ }
+ $return = [
+ "code"=> 0,
+ "msg"=> "",
+ "count"=> $count? $count : 0,
+ "data" => $list? $list : [],
+ ];
+ $jsonReturn = json_encode($return);
+ if ($jsonReturn === false) {
+ $errorMessage = json_last_error_msg();
+ $errorResponse = [
+ "code" => 1,
+ "msg" => "JSON 编码失败,请刷新重试: " . $errorMessage,
+ "count" => 0,
+ "data" => [],
+ ];
+ exit(json_encode($errorResponse));
+ }
+ exit($jsonReturn);
+ }
+} else {
!isset($_GET['page']) && $_GET['page']=1;
$lpp = empty($_GET['lpp']) ? 20 : $_GET['lpp'];
$keyword = isset($_GET['keyword']) ? trim($_GET['keyword']) : '';
$checklpp = array();
$checklpp[$lpp] = 'selected="selected"';
$extrainput = '';
- $systemlog_setting = unserialize($_G["setting"]["systemlog_setting"]);
$operationarr = array_keys($systemlog_setting);
- $operation = in_array($_GET['operation'], $operationarr) ? $_GET['operation'] : "cplog";
+ $operation = in_array($operation, $operationarr) ? $operation : "cplog";
$navtitle=$systemlog_setting[$operation]["title"].' - '.lang('appname');
$page = (isset($_GET['page'])) ? intval($_GET['page']) : 1;
$type = isset($_GET['type']) ? trim($_GET['type']) : '';
@@ -39,103 +167,101 @@ if($type=="list"){
$theurl = BASESCRIPT . "?" . url_implode($gets);
$logdir = DZZ_ROOT.'./data/log/';
$logfiles = get_log_files($logdir, $operation);
-
- if($logfiles) $logfiles=array_reverse($logfiles);
- //error_reporting(E_ALL);
- $firstlogs = file( $logdir.$logfiles[0] ) ;
- $firstlogsnum = count($firstlogs);
- $countlogfile=count($logfiles);
- $count = ($countlogfile-1)*4000+$firstlogsnum;
- $logs = array();
- $jishu=4000;//每个日志文件最多行数
- $start = ($page - 1) * $lpp;
- $lastlog=$last_secondlog="";
-
- $newdata=array();
- foreach($logfiles as $k=>$v){
- $nowfilemaxnum=($jishu*($k+1))-($jishu-$firstlogsnum);
- $startnum=($nowfilemaxnum-$jishu)<=0?0:($nowfilemaxnum-$jishu+1);
- $newdata[]=array("file"=>$v,"start"=>$startnum,"end"=>$nowfilemaxnum);
- }
- //print_R($newdata);
- //查询当前分页数据位于哪个日志文件
- $lastlog=$last_secondlog="";
- foreach($newdata as $k=>$v){
- if( $start<=$v["end"]){
- $lastlog=$v;
- if( ($start+$lpp)<$v["end"]){
-
- }else{
- if( isset($newdata[$k+1])){
- $last_secondlog=$newdata[$k+1];
+ if ($logfiles) {
+ $logfiles = array_reverse($logfiles);
+ $firstlogs = file($logdir.$logfiles[0]);
+ $firstlogsnum = count($firstlogs);
+ $countlogfile=count($logfiles);
+ $count = ($countlogfile-1)*4000+$firstlogsnum;
+ $logs = array();
+ $jishu=4000;//每个日志文件最多行数
+ $start = ($page - 1) * $lpp;
+ $lastlog=$last_secondlog="";
+
+ $newdata=array();
+ foreach($logfiles as $k=>$v){
+ $nowfilemaxnum=($jishu*($k+1))-($jishu-$firstlogsnum);
+ $startnum=($nowfilemaxnum-$jishu)<=0?0:($nowfilemaxnum-$jishu+1);
+ $newdata[]=array("file"=>$v,"start"=>$startnum,"end"=>$nowfilemaxnum);
+ }
+ //print_R($newdata);
+ //查询当前分页数据位于哪个日志文件
+ $lastlog=$last_secondlog="";
+ foreach($newdata as $k=>$v){
+ if( $start<=$v["end"]){
+ $lastlog=$v;
+ if( ($start+$lpp)<$v["end"]){
+
+ }else{
+ if( isset($newdata[$k+1])){
+ $last_secondlog=$newdata[$k+1];
+ }
}
- }
- break;
- }
- }
-
- $j=0;
- for($i=$lastlog["start"];$i<$lastlog["end"];$i++){
- if( $start<=($lastlog["start"]+$j) ){
- break;
- }
- $j++;
- }
- //获取数据开始
- $logs = file( $logdir.$lastlog["file"] );
- $logs = array_reverse($logs);
- if($keyword){
- foreach($logs as $key => $value) {
- if(!empty($_GET['keyword']) && strpos($value, $_GET['keyword']) === FALSE) {
- unset($logs[$key]);
- }
- }
- $count = count($logs);
- }
- if( $lastlog["file"]!=$logfiles[0] ){
- $j++;
- }
- $logs = array_slice($logs, $j, $lpp);
- $onecountget = count($logs);
-
- $jj=0;
- if( $last_secondlog ){
- for($i=$last_secondlog["start"];$i<$last_secondlog["end"];$i++){
- if( ($jj)>= ($lpp-$onecountget) ){//$last_secondlog["start"] ){
break;
}
- $jj++;
- }
- }
-
- if($last_secondlog){
- $logs2 = file( $logdir.$last_secondlog["file"] );
- $logs2 = array_reverse($logs2);
- $end=$lpp-count($logs);
- $logs2 = array_slice( $logs2, 0, $jj);
- $logs=array_merge($logs,$logs2);
- }
- $usergroup = array();
- foreach(C::t('usergroup')->range() as $group) {
- $usergroup[$group['groupid']] = $group['grouptitle'];
- }
- $list=array();
- foreach($logs as $k => $logrow) {
- $log = explode("\t", $logrow);
- if(empty($log[1])) {
- continue;
}
- $log[1] = dgmdate($log[1], 'y-n-j H:i:s');
- $log[2] = $log[2];
- $log[2] = ($log[2] != $_G['member']['username'] ? "
$log[2] " : $log[2]);
- $log[3] = $usergroup[$log[3]];
- $list[$k]=$log;
- }
- $multipage = multi($count, $lpp, $page, $theurl,'pull-right');
- include template('list');
+
+ $j=0;
+ for($i=$lastlog["start"];$i<$lastlog["end"];$i++){
+ if( $start<=($lastlog["start"]+$j) ){
+ break;
+ }
+ $j++;
+ }
+ //获取数据开始
+ $logs = file($logdir.$lastlog["file"]);
+ $logs = array_reverse($logs);
+ if($keyword){
+ foreach($logs as $key => $value) {
+ if(!empty($_GET['keyword']) && strpos($value, $_GET['keyword']) === FALSE) {
+ unset($logs[$key]);
+ }
+ }
+ $count = count($logs);
+ }
+ if( $lastlog["file"]!=$logfiles[0] ){
+ $j++;
+ }
+ $logs = array_slice($logs, $j, $lpp);
+ $onecountget = count($logs);
+
+ $jj=0;
+ if( $last_secondlog ){
+ for($i=$last_secondlog["start"];$i<$last_secondlog["end"];$i++){
+ if( ($jj)>= ($lpp-$onecountget)){
+ break;
+ }
+ $jj++;
+ }
+ }
+
+ if($last_secondlog){
+ $logs2 = file( $logdir.$last_secondlog["file"] );
+ $logs2 = array_reverse($logs2);
+ $end=$lpp-count($logs);
+ $logs2 = array_slice( $logs2, 0, $jj);
+ $logs=array_merge($logs,$logs2);
+ }
+ $usergroup = array();
+ foreach(C::t('usergroup')->range() as $group) {
+ $usergroup[$group['groupid']] = $group['grouptitle'];
+ }
+ $list=array();
+ foreach($logs as $k => $logrow) {
+ $log = explode("\t", $logrow);
+ if(empty($log[1])) {
+ continue;
+ }
+ $log[1] = dgmdate($log[1], 'y-n-j H:i:s');
+ $log[2] = $log[2];
+ $log[2] = ($log[2] != $_G['member']['username'] ? "
$log[2] " : $log[2]);
+ $log[3] = $usergroup[$log[3]];
+ $list[$k]=$log;
+ }
+ $multipage = multi($count, $lpp, $page, $theurl,'pull-right');
+ }
}
-
-
+include template('list');
function getactionarray() {
$isfounder = true;
unset($topmenu['index'], $menu['index']);
diff --git a/admin/systemlog/language/zh-cn/lang.php b/admin/systemlog/language/zh-cn/lang.php
index 16d7af4..32f21be 100644
--- a/admin/systemlog/language/zh-cn/lang.php
+++ b/admin/systemlog/language/zh-cn/lang.php
@@ -1,15 +1,10 @@
'系统日志',
+ 'appname'=>'系统日志',
'logs' => '运行记录',
- 'systemlog_setting'=>'设置',
- 'systemlog_list'=>'日志列表',
- 'info'=>'信息',
- 'loginfo'=>'日志信息',
- 'visit'=>'访问页面',
- 'from'=>'来源页面',
+ 'systemlog_setting'=>'设置',
+ 'systemlog_list'=>'日志列表',
'logswitch'=>'日志开关',
- 'logtype'=>'日志类型',
'logtypename'=>'日志类型名称',
'logtype'=>'日志类型',
'logflag'=>'日志标识',
diff --git a/admin/systemlog/template/lyear/admin.htm b/admin/systemlog/template/lyear/admin.htm
new file mode 100644
index 0000000..d5be3d3
--- /dev/null
+++ b/admin/systemlog/template/lyear/admin.htm
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/systemlog/template/lyear/list.htm b/admin/systemlog/template/lyear/list.htm
new file mode 100644
index 0000000..88468aa
--- /dev/null
+++ b/admin/systemlog/template/lyear/list.htm
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/systemlog/template/lyear/lyear_left.htm b/admin/systemlog/template/lyear/lyear_left.htm
new file mode 100644
index 0000000..997193d
--- /dev/null
+++ b/admin/systemlog/template/lyear/lyear_left.htm
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/admin/template/lyear/lyear_header_left.htm b/admin/template/lyear/lyear_header_left.htm
new file mode 100644
index 0000000..62776b8
--- /dev/null
+++ b/admin/template/lyear/lyear_header_left.htm
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/config/config_default.php b/config/config_default.php
index a81f052..4d7255b 100644
--- a/config/config_default.php
+++ b/config/config_default.php
@@ -160,6 +160,7 @@ $_config['admincp']['checkip'] = 1; // 后台管理操作是否验证管理
$_config['admincp']['runquery'] = 0; // 是否允许后台运行 SQL 语句 1=是 0=否[安全]
$_config['admincp']['dbimport'] = 0; // 是否允许后台恢复网站数据 1=是 0=否[安全]
$_config['userlogin']['checkip'] = 1; //用户登录错误验证ip,对于同一ip同时使用时建议设置为0,否则当有一位用户登录错误次数超过5次,该ip被锁定15分钟,导致其他的同IP用户无法登录;
+$_config['debug'] = 0;
//$_config['system_os'] = 'linux'; //windows,linux,mac,系统会自动判断
//$_config['system_charset']='utf-8'; //操作系统编码,不设置系统将根据操作系统类型来判断linux:utf-8;windows:gbk;
diff --git a/config/config_frame.php b/config/config_frame.php
index cb618df..0e2f720 100644
--- a/config/config_frame.php
+++ b/config/config_frame.php
@@ -10,7 +10,7 @@ $_config['namespacelist'] = array(
'misc' => DZZ_ROOT.'misc'
);
-$_config['default_mod'] = 'index';
+$_config['default_mod'] = 'explorer';
$_config['default_op'] = 'index';
diff --git a/core/api/BaiduPCS/BaiduUtils.php b/core/api/BaiduPCS/BaiduUtils.php
index bf92557..8aca8b3 100644
--- a/core/api/BaiduPCS/BaiduUtils.php
+++ b/core/api/BaiduPCS/BaiduUtils.php
@@ -274,7 +274,7 @@ class BaiduUtils
self::$boundary = $boundary = md5('BAIDU-PHP-SDK-V2' . microtime(true));
foreach ($params as $key => $value) {
- if ($value{0} == '@') {
+ if ($value[0] == '@') {
$url = ltrim($value, '@');
$content = file_get_contents($url);
$array = explode('?', basename($url));
diff --git a/core/api/Qcos/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php b/core/api/Qcos/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php
index 4a2833f..b88d1ad 100644
--- a/core/api/Qcos/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php
+++ b/core/api/Qcos/vendor/guzzlehttp/guzzle-services/src/SchemaValidator.php
@@ -212,7 +212,7 @@ class SchemaValidator
} elseif ($type == 'array' && $valueIsArray && $param->getItems()) {
foreach ($value as $i => &$item) {
// Validate each item in an array against the items attribute of the schema
- $this->recursiveProcess($param->getItems(), $item, $path . "[{$i}]", $depth + 1);
+ $this->recursiveProcess($param->getItems(), $item, $path . "[[$i]]", $depth + 1);
}
}
diff --git a/core/api/wopi/wopi.php b/core/api/wopi/wopi.php
index b620f25..210fa5e 100644
--- a/core/api/wopi/wopi.php
+++ b/core/api/wopi/wopi.php
@@ -180,7 +180,7 @@ class Wopi
$fileExtension = $meta['ext'];
$guid = dzzencode(getglobal('uid').'|'.$lock);
- $wopi_url_temlpate = "WOPISrc={0}&access_token={1}";
+ $wopi_url_temlpate = "WOPISrc=[0]&access_token=[1]";
$fileID=dzzencode($meta['path']);
$discovery=self::getActionByDiscovery($ooServerURL);
if($discovery['error']) return $discovery;
@@ -234,8 +234,8 @@ class Wopi
$fileUrl = urlencode($internalUrl. "wopi/files/" . $fileID);
$requestUrl = preg_replace("/<.*>/", "", $urlsrc);
- $requestUrl = $requestUrl . str_replace('{1}', $guid, $wopi_url_temlpate);
- $requestUrl = str_replace("{0}", $fileUrl, $requestUrl).'&ui=zh-CN&rs=zh-CN';
+ $requestUrl = $requestUrl . str_replace('[1]', $guid, $wopi_url_temlpate);
+ $requestUrl = str_replace("[0]", $fileUrl, $requestUrl).'&ui=zh-CN&rs=zh-CN';
$wopiSrc=$internalUrl. "wopi/files/$fileID?access_token=$guid&ui=zh-CN&rs=zh-CN";
$ret=array(
'fileID'=>$fileID,
diff --git a/core/class/PHPExcel/Calculation.php b/core/class/PHPExcel/Calculation.php
index b609b0d..0469d1d 100644
--- a/core/class/PHPExcel/Calculation.php
+++ b/core/class/PHPExcel/Calculation.php
@@ -2183,7 +2183,7 @@ class PHPExcel_Calculation {
*/
public static function _unwrapResult($value) {
if (is_string($value)) {
- if ((isset($value{0})) && ($value{0} == '"') && (substr($value,-1) == '"')) {
+ if ((isset($value[0])) && ($value[0] == '"') && (substr($value,-1) == '"')) {
return substr($value,1,-1);
}
// Convert numeric errors to NaN error
@@ -2291,9 +2291,9 @@ class PHPExcel_Calculation {
// Basic validation that this is indeed a formula
// We return an empty array if not
$formula = trim($formula);
- if ((!isset($formula{0})) || ($formula{0} != '=')) return array();
+ if ((!isset($formula[0])) || ($formula[0] != '=')) return array();
$formula = ltrim(substr($formula,1));
- if (!isset($formula{0})) return array();
+ if (!isset($formula[0])) return array();
// Parse the formula and return the token stack
return $this->_parseFormula($formula);
@@ -2369,9 +2369,9 @@ class PHPExcel_Calculation {
// Basic validation that this is indeed a formula
// We simply return the cell value if not
$formula = trim($formula);
- if ($formula{0} != '=') return self::_wrapResult($formula);
+ if ($formula[0] != '=') return self::_wrapResult($formula);
$formula = ltrim(substr($formula,1));
- if (!isset($formula{0})) return self::_wrapResult($formula);
+ if (!isset($formula[0])) return self::_wrapResult($formula);
$pCellParent = ($pCell !== NULL) ? $pCell->getWorksheet() : NULL;
$wsTitle = ($pCellParent !== NULL) ? $pCellParent->getTitle() : "\x00Wrk";
@@ -2380,7 +2380,7 @@ class PHPExcel_Calculation {
return $cellValue;
}
- if (($wsTitle{0} !== "\x00") && ($this->_cyclicReferenceStack->onStack($wsTitle.'!'.$cellID))) {
+ if (($wsTitle[0] !== "\x00") && ($this->_cyclicReferenceStack->onStack($wsTitle.'!'.$cellID))) {
if ($this->cyclicFormulaCount <= 0) {
return $this->_raiseFormulaError('Cyclic Reference in Formula');
} elseif (($this->_cyclicFormulaCount >= $this->cyclicFormulaCount) &&
@@ -2629,7 +2629,7 @@ class PHPExcel_Calculation {
} else {
if ($value == '') {
return 'an empty string';
- } elseif ($value{0} == '#') {
+ } elseif ($value[0] == '#') {
return 'a '.$value.' error';
} else {
$typeString = 'a string';
@@ -2758,10 +2758,10 @@ class PHPExcel_Calculation {
// Loop through the formula extracting each operator and operand in turn
while(TRUE) {
//echo 'Assessing Expression '.substr($formula, $index),PHP_EOL;
- $opCharacter = $formula{$index}; // Get the first character of the value at the current index position
+ $opCharacter = $formula[$index]; // Get the first character of the value at the current index position
//echo 'Initial character of expression block is '.$opCharacter,PHP_EOL;
- if ((isset(self::$_comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$_comparisonOperators[$formula{$index+1}]))) {
- $opCharacter .= $formula{++$index};
+ if ((isset(self::$_comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$_comparisonOperators[$formula[$index+1]]))) {
+ $opCharacter .= $formula[++$index];
//echo 'Initial character of expression block is comparison operator '.$opCharacter.PHP_EOL;
}
@@ -3036,11 +3036,11 @@ class PHPExcel_Calculation {
}
}
// Ignore white space
- while (($formula{$index} == "\n") || ($formula{$index} == "\r")) {
+ while (($formula[$index] == "\n") || ($formula[$index] == "\r")) {
++$index;
}
- if ($formula{$index} == ' ') {
- while ($formula{$index} == ' ') {
+ if ($formula[$index] == ' ') {
+ while ($formula[$index] == ' ') {
++$index;
}
// If we're expecting an operator, but only have a space between the previous and next operands (and both are
@@ -3456,7 +3456,7 @@ class PHPExcel_Calculation {
// echo 'Token is a PHPExcel constant: '.$excelConstant.'
';
$stack->push('Constant Value',self::$_ExcelConstants[$excelConstant]);
$this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->_showTypeDetails(self::$_ExcelConstants[$excelConstant]));
- } elseif ((is_numeric($token)) || ($token === NULL) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) {
+ } elseif ((is_numeric($token)) || ($token === NULL) || (is_bool($token)) || ($token == '') || ($token[0] == '"') || ($token[0] == '#')) {
// echo 'Token is a number, boolean, string, null or an Excel error
';
$stack->push('Value',$token);
// if the token is a named range, push the named range name onto the stack
@@ -3498,11 +3498,11 @@ class PHPExcel_Calculation {
if (is_string($operand)) {
// We only need special validations for the operand if it is a string
// Start by stripping off the quotation marks we use to identify true excel string values internally
- if ($operand > '' && $operand{0} == '"') { $operand = self::_unwrapResult($operand); }
+ if ($operand > '' && $operand[0] == '"') { $operand = self::_unwrapResult($operand); }
// If the string is a numeric value, we treat it as a numeric, so no further testing
if (!is_numeric($operand)) {
// If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
- if ($operand > '' && $operand{0} == '#') {
+ if ($operand > '' && $operand[0] == '#') {
$stack->push('Value', $operand);
$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($operand));
return FALSE;
@@ -3555,8 +3555,8 @@ class PHPExcel_Calculation {
}
// Simple validate the two operands if they are string values
- if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') { $operand1 = self::_unwrapResult($operand1); }
- if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') { $operand2 = self::_unwrapResult($operand2); }
+ if (is_string($operand1) && $operand1 > '' && $operand1[0] == '"') { $operand1 = self::_unwrapResult($operand1); }
+ if (is_string($operand2) && $operand2 > '' && $operand2[0] == '"') { $operand2 = self::_unwrapResult($operand2); }
// Use case insensitive comparaison if not OpenOffice mode
if (PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE)
diff --git a/core/class/PHPExcel/Calculation/Engineering.php b/core/class/PHPExcel/Calculation/Engineering.php
index 7e32aa8..0c97607 100644
--- a/core/class/PHPExcel/Calculation/Engineering.php
+++ b/core/class/PHPExcel/Calculation/Engineering.php
@@ -708,7 +708,7 @@ class PHPExcel_Calculation_Engineering {
// Split the input into its Real and Imaginary components
$leadingSign = 0;
if (strlen($workString) > 0) {
- $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0;
+ $leadingSign = (($workString[0] == '+') || ($workString[0] == '-')) ? 1 : 0;
}
$power = '';
$realNumber = strtok($workString, '+-');
@@ -747,10 +747,10 @@ class PHPExcel_Calculation_Engineering {
* @return string The "cleaned" complex number
*/
private static function _cleanComplex($complexNumber) {
- if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1);
- if ($complexNumber{0} == '0') $complexNumber = substr($complexNumber,1);
- if ($complexNumber{0} == '.') $complexNumber = '0'.$complexNumber;
- if ($complexNumber{0} == '+') $complexNumber = substr($complexNumber,1);
+ if ($complexNumber[0] == '+') $complexNumber = substr($complexNumber,1);
+ if ($complexNumber[0] == '0') $complexNumber = substr($complexNumber,1);
+ if ($complexNumber[0] == '.') $complexNumber = '0'.$complexNumber;
+ if ($complexNumber[0] == '+') $complexNumber = substr($complexNumber,1);
return $complexNumber;
}
diff --git a/core/class/PHPExcel/Calculation/FormulaParser.php b/core/class/PHPExcel/Calculation/FormulaParser.php
index 754a638..8536a82 100644
--- a/core/class/PHPExcel/Calculation/FormulaParser.php
+++ b/core/class/PHPExcel/Calculation/FormulaParser.php
@@ -159,7 +159,7 @@ class PHPExcel_Calculation_FormulaParser {
// Check if the formula has a valid starting =
$formulaLength = strlen($this->_formula);
- if ($formulaLength < 2 || $this->_formula{0} != '=') return;
+ if ($formulaLength < 2 || $this->_formula[0] != '=') return;
// Helper variables
$tokens1 = $tokens2 = $stack = array();
@@ -179,7 +179,7 @@ class PHPExcel_Calculation_FormulaParser {
// embeds are doubled
// end marks token
if ($inString) {
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) {
$value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE;
++$index;
@@ -189,7 +189,7 @@ class PHPExcel_Calculation_FormulaParser {
$value = "";
}
} else {
- $value .= $this->_formula{$index};
+ $value .= $this->_formula[$index];
}
++$index;
continue;
@@ -199,7 +199,7 @@ class PHPExcel_Calculation_FormulaParser {
// embeds are double
// end does not mark a token
if ($inPath) {
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
if ((($index + 2) <= $formulaLength) && ($this->_formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) {
$value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE;
++$index;
@@ -207,7 +207,7 @@ class PHPExcel_Calculation_FormulaParser {
$inPath = false;
}
} else {
- $value .= $this->_formula{$index};
+ $value .= $this->_formula[$index];
}
++$index;
continue;
@@ -217,10 +217,10 @@ class PHPExcel_Calculation_FormulaParser {
// no embeds (changed to "()" by Excel)
// end does not mark a token
if ($inRange) {
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) {
$inRange = false;
}
- $value .= $this->_formula{$index};
+ $value .= $this->_formula[$index];
++$index;
continue;
}
@@ -228,7 +228,7 @@ class PHPExcel_Calculation_FormulaParser {
// error values
// end marks a token, determined from absolute list of values
if ($inError) {
- $value .= $this->_formula{$index};
+ $value .= $this->_formula[$index];
++$index;
if (in_array($value, $ERRORS)) {
$inError = false;
@@ -239,10 +239,10 @@ class PHPExcel_Calculation_FormulaParser {
}
// scientific notation check
- if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->_formula{$index}) !== false) {
+ if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->_formula[$index]) !== false) {
if (strlen($value) > 1) {
- if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->_formula{$index}) != 0) {
- $value .= $this->_formula{$index};
+ if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->_formula[$index]) != 0) {
+ $value .= $this->_formula[$index];
++$index;
continue;
}
@@ -252,7 +252,7 @@ class PHPExcel_Calculation_FormulaParser {
// independent character evaluation (order not important)
// establish state-dependent character evaluations
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
if (strlen($value > 0)) { // unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
$value = "";
@@ -262,7 +262,7 @@ class PHPExcel_Calculation_FormulaParser {
continue;
}
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
if (strlen($value) > 0) { // unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
$value = "";
@@ -272,14 +272,14 @@ class PHPExcel_Calculation_FormulaParser {
continue;
}
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) {
$inRange = true;
$value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN;
++$index;
continue;
}
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::ERROR_START) {
if (strlen($value) > 0) { // unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
$value = "";
@@ -291,7 +291,7 @@ class PHPExcel_Calculation_FormulaParser {
}
// mark start and end of arrays and array rows
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) {
if (strlen($value) > 0) { // unexpected
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
$value = "";
@@ -309,7 +309,7 @@ class PHPExcel_Calculation_FormulaParser {
continue;
}
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::SEMICOLON) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@@ -331,7 +331,7 @@ class PHPExcel_Calculation_FormulaParser {
continue;
}
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@@ -352,14 +352,14 @@ class PHPExcel_Calculation_FormulaParser {
}
// trim white-space
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::WHITESPACE) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
}
$tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE);
++$index;
- while (($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) {
+ while (($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) {
++$index;
}
continue;
@@ -379,29 +379,29 @@ class PHPExcel_Calculation_FormulaParser {
}
// standard infix operators
- if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->_formula{$index}) !== false) {
+ if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->_formula[$index]) !== false) {
if (strlen($value) > 0) {
$tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
}
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX);
+ $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula[$index], PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX);
++$index;
continue;
}
// standard postfix operators (only one)
- if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->_formula{$index}) !== false) {
+ if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->_formula[$index]) !== false) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
}
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
+ $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->_formula[$index], PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
++$index;
continue;
}
// start subexpression or function
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) {
if (strlen($value) > 0) {
$tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
$tokens1[] = $tmp;
@@ -417,7 +417,7 @@ class PHPExcel_Calculation_FormulaParser {
}
// function, subexpression, or array parameters, or operand unions
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::COMMA) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@@ -438,7 +438,7 @@ class PHPExcel_Calculation_FormulaParser {
}
// stop subexpression
- if ($this->_formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) {
+ if ($this->_formula[$index] == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) {
if (strlen($value) > 0) {
$tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
$value = "";
@@ -454,7 +454,7 @@ class PHPExcel_Calculation_FormulaParser {
}
// token accumulation
- $value .= $this->_formula{$index};
+ $value .= $this->_formula[$index];
++$index;
}
diff --git a/core/class/PHPExcel/Calculation/Functions.php b/core/class/PHPExcel/Calculation/Functions.php
index 4ad1dd3..36edc52 100644
--- a/core/class/PHPExcel/Calculation/Functions.php
+++ b/core/class/PHPExcel/Calculation/Functions.php
@@ -308,9 +308,9 @@ class PHPExcel_Calculation_Functions {
public static function _ifCondition($condition) {
$condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition);
- if (!isset($condition{0}))
+ if (!isset($condition[0]))
$condition = '=""';
- if (!in_array($condition{0},array('>', '<', '='))) {
+ if (!in_array($condition[0],array('>', '<', '='))) {
if (!is_numeric($condition)) { $condition = PHPExcel_Calculation::_wrapResult(strtoupper($condition)); }
return '='.$condition;
} else {
@@ -531,7 +531,7 @@ class PHPExcel_Calculation_Functions {
break;
case 'string' :
// Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
+ if ((strlen($value) > 0) && ($value[0] == '#')) {
return $value;
}
break;
@@ -581,7 +581,7 @@ class PHPExcel_Calculation_Functions {
//break;
} elseif(is_string($value)) {
// Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
+ if ((strlen($value) > 0) && ($value[0] == '#')) {
return 16;
}
return 2;
diff --git a/core/class/PHPExcel/Calculation/TextData.php b/core/class/PHPExcel/Calculation/TextData.php
index d1ba272..2a0da50 100644
--- a/core/class/PHPExcel/Calculation/TextData.php
+++ b/core/class/PHPExcel/Calculation/TextData.php
@@ -48,19 +48,19 @@ class PHPExcel_Calculation_TextData {
private static $_invalidChars = Null;
private static function _uniord($c) {
- if (ord($c{0}) >=0 && ord($c{0}) <= 127)
- return ord($c{0});
- if (ord($c{0}) >= 192 && ord($c{0}) <= 223)
- return (ord($c{0})-192)*64 + (ord($c{1})-128);
- if (ord($c{0}) >= 224 && ord($c{0}) <= 239)
- return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128);
- if (ord($c{0}) >= 240 && ord($c{0}) <= 247)
- return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128);
- if (ord($c{0}) >= 248 && ord($c{0}) <= 251)
- return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128);
- if (ord($c{0}) >= 252 && ord($c{0}) <= 253)
- return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128);
- if (ord($c{0}) >= 254 && ord($c{0}) <= 255) //error
+ if (ord($c[0]) >=0 && ord($c[0]) <= 127)
+ return ord($c[0]);
+ if (ord($c[0]) >= 192 && ord($c[0]) <= 223)
+ return (ord($c[0])-192)*64 + (ord($c[1])-128);
+ if (ord($c[0]) >= 224 && ord($c[0]) <= 239)
+ return (ord($c[0])-224)*4096 + (ord($c[1])-128)*64 + (ord($c[2])-128);
+ if (ord($c[0]) >= 240 && ord($c[0]) <= 247)
+ return (ord($c[0])-240)*262144 + (ord($c[1])-128)*4096 + (ord($c[2])-128)*64 + (ord($c[3])-128);
+ if (ord($c[0]) >= 248 && ord($c[0]) <= 251)
+ return (ord($c[0])-248)*16777216 + (ord($c[1])-128)*262144 + (ord($c[2])-128)*4096 + (ord($c[3])-128)*64 + (ord($c[4])-128);
+ if (ord($c[0]) >= 252 && ord($c[0]) <= 253)
+ return (ord($c[0])-252)*1073741824 + (ord($c[1])-128)*16777216 + (ord($c[2])-128)*262144 + (ord($c[3])-128)*4096 + (ord($c[4])-128)*64 + (ord($c[5])-128);
+ if (ord($c[0]) >= 254 && ord($c[0]) <= 255) //error
return PHPExcel_Calculation_Functions::VALUE();
return 0;
} // function _uniord()
diff --git a/core/class/PHPExcel/Cell.php b/core/class/PHPExcel/Cell.php
index 1788559..c560ffe 100644
--- a/core/class/PHPExcel/Cell.php
+++ b/core/class/PHPExcel/Cell.php
@@ -769,19 +769,19 @@ class PHPExcel_Cell
// We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
// for improved performance
- if (isset($pString{0})) {
- if (!isset($pString{1})) {
+ if (isset($pString[0])) {
+ if (!isset($pString[1])) {
$_indexCache[$pString] = $_columnLookup[$pString];
return $_indexCache[$pString];
- } elseif(!isset($pString{2})) {
- $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}];
+ } elseif(!isset($pString[2])) {
+ $_indexCache[$pString] = $_columnLookup[$pString[0]] * 26 + $_columnLookup[$pString[1]];
return $_indexCache[$pString];
- } elseif(!isset($pString{3})) {
- $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}];
+ } elseif(!isset($pString[3])) {
+ $_indexCache[$pString] = $_columnLookup[$pString[0]] * 676 + $_columnLookup[$pString[1]] * 26 + $_columnLookup[$pString[2]];
return $_indexCache[$pString];
}
}
- throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
+ throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString[0])) ? "longer than 3 characters" : "empty"));
}
/**
diff --git a/core/class/PHPExcel/Cell/DefaultValueBinder.php b/core/class/PHPExcel/Cell/DefaultValueBinder.php
index f1880fa..67d8a1f 100644
--- a/core/class/PHPExcel/Cell/DefaultValueBinder.php
+++ b/core/class/PHPExcel/Cell/DefaultValueBinder.php
@@ -83,7 +83,7 @@ class PHPExcel_Cell_DefaultValueBinder implements PHPExcel_Cell_IValueBinder
} elseif ($pValue instanceof PHPExcel_RichText) {
return PHPExcel_Cell_DataType::TYPE_INLINE;
- } elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
+ } elseif ($pValue[0] === '=' && strlen($pValue) > 1) {
return PHPExcel_Cell_DataType::TYPE_FORMULA;
} elseif (is_bool($pValue)) {
diff --git a/core/class/PHPExcel/IOFactory.php b/core/class/PHPExcel/IOFactory.php
index 69ec8b6..1b0bfd6 100644
--- a/core/class/PHPExcel/IOFactory.php
+++ b/core/class/PHPExcel/IOFactory.php
@@ -52,8 +52,8 @@ class PHPExcel_IOFactory
* @static
*/
private static $_searchLocations = array(
- array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ),
- array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' )
+ array( 'type' => 'IWriter', 'path' => 'PHPExcel/Writer/[0].php', 'class' => 'PHPExcel_Writer_[0]' ),
+ array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/[0].php', 'class' => 'PHPExcel_Reader_[0]' )
);
/**
@@ -112,8 +112,8 @@ class PHPExcel_IOFactory
* @static
* @access public
* @param string $type Example: IWriter
- * @param string $location Example: PHPExcel/Writer/{0}.php
- * @param string $classname Example: PHPExcel_Writer_{0}
+ * @param string $location Example: PHPExcel/Writer/[0].php
+ * @param string $classname Example: PHPExcel_Writer_[0]
*/
public static function addSearchLocation($type = '', $location = '', $classname = '') {
self::$_searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname );
@@ -136,7 +136,7 @@ class PHPExcel_IOFactory
// Include class
foreach (self::$_searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) {
- $className = str_replace('{0}', $writerType, $searchLocation['class']);
+ $className = str_replace('[0]', $writerType, $searchLocation['class']);
$instance = new $className($phpExcel);
if ($instance !== NULL) {
@@ -165,7 +165,7 @@ class PHPExcel_IOFactory
// Include class
foreach (self::$_searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) {
- $className = str_replace('{0}', $readerType, $searchLocation['class']);
+ $className = str_replace('[0]', $readerType, $searchLocation['class']);
$instance = new $className();
if ($instance !== NULL) {
diff --git a/core/class/PHPExcel/Reader/Excel2003XML.php b/core/class/PHPExcel/Reader/Excel2003XML.php
index ce1f31d..4cea4e5 100644
--- a/core/class/PHPExcel/Reader/Excel2003XML.php
+++ b/core/class/PHPExcel/Reader/Excel2003XML.php
@@ -699,12 +699,12 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
// Empty R reference is the current row
if ($rowReference == '') $rowReference = $rowID;
// Bracketed R references are relative to the current row
- if ($rowReference{0} == '[') $rowReference = $rowID + trim($rowReference,'[]');
+ if ($rowReference[0] == '[') $rowReference = $rowID + trim($rowReference,'[]');
$columnReference = $cellReference[4][0];
// Empty C reference is the current column
if ($columnReference == '') $columnReference = $columnNumber;
// Bracketed C references are relative to the current column
- if ($columnReference{0} == '[') $columnReference = $columnNumber + trim($columnReference,'[]');
+ if ($columnReference[0] == '[') $columnReference = $columnNumber + trim($columnReference,'[]');
$A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference;
$value = substr_replace($value,$A1CellReference,$cellReference[0][1],strlen($cellReference[0][0]));
}
diff --git a/core/class/PHPExcel/Reader/Excel5.php b/core/class/PHPExcel/Reader/Excel5.php
index 91e0fa0..b53d27d 100644
--- a/core/class/PHPExcel/Reader/Excel5.php
+++ b/core/class/PHPExcel/Reader/Excel5.php
@@ -1859,7 +1859,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// offset: 0; size: 2; 0 = base 1900, 1 = base 1904
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
- if (ord($recordData{0}) == 1) {
+ if (ord($recordData[0]) == 1) {
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
}
}
@@ -2057,7 +2057,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// offset: 6; size: 1; Alignment and text break
// bit 2-0, mask 0x07; horizontal alignment
- $horAlign = (0x07 & ord($recordData{6})) >> 0;
+ $horAlign = (0x07 & ord($recordData[6])) >> 0;
switch ($horAlign) {
case 0:
$objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_GENERAL);
@@ -2082,7 +2082,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
break;
}
// bit 3, mask 0x08; wrap text
- $wrapText = (0x08 & ord($recordData{6})) >> 3;
+ $wrapText = (0x08 & ord($recordData[6])) >> 3;
switch ($wrapText) {
case 0:
$objStyle->getAlignment()->setWrapText(false);
@@ -2092,7 +2092,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
break;
}
// bit 6-4, mask 0x70; vertical alignment
- $vertAlign = (0x70 & ord($recordData{6})) >> 4;
+ $vertAlign = (0x70 & ord($recordData[6])) >> 4;
switch ($vertAlign) {
case 0:
$objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
@@ -2110,7 +2110,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
if ($this->_version == self::XLS_BIFF8) {
// offset: 7; size: 1; XF_ROTATION: Text rotation angle
- $angle = ord($recordData{7});
+ $angle = ord($recordData[7]);
$rotation = 0;
if ($angle <= 90) {
$rotation = $angle;
@@ -2123,11 +2123,11 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// offset: 8; size: 1; Indentation, shrink to cell size, and text direction
// bit: 3-0; mask: 0x0F; indent level
- $indent = (0x0F & ord($recordData{8})) >> 0;
+ $indent = (0x0F & ord($recordData[8])) >> 0;
$objStyle->getAlignment()->setIndent($indent);
// bit: 4; mask: 0x10; 1 = shrink content to fit into cell
- $shrinkToFit = (0x10 & ord($recordData{8})) >> 4;
+ $shrinkToFit = (0x10 & ord($recordData[8])) >> 4;
switch ($shrinkToFit) {
case 0:
$objStyle->getAlignment()->setShrinkToFit(false);
@@ -2209,7 +2209,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// BIFF5
// offset: 7; size: 1; Text orientation and flags
- $orientationAndFlags = ord($recordData{7});
+ $orientationAndFlags = ord($recordData[7]);
// bit: 1-0; mask: 0x03; XF_ORIENTATION: Text orientation
$xfOrientation = (0x03 & $orientationAndFlags) >> 0;
@@ -2333,7 +2333,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2349,7 +2349,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2365,7 +2365,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2381,7 +2381,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2397,7 +2397,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2413,7 +2413,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2429,7 +2429,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2445,7 +2445,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xclrValue = substr($extData, 4, 4); // color value (value based on color type)
if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
+ $rgb = sprintf('%02X%02X%02X', ord($xclrValue[0]), ord($xclrValue[1]), ord($xclrValue[2]));
// modify the relevant style property
if ( isset($this->_mapCellXfIndex[$ixfe]) ) {
@@ -2487,7 +2487,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
if ($isBuiltIn) {
// offset: 2; size: 1; identifier for built-in style
- $builtInId = ord($recordData{2});
+ $builtInId = ord($recordData[2]);
switch ($builtInId) {
case 0x00:
@@ -2554,7 +2554,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$this->_pos += 4 + $length;
// offset: 4; size: 1; sheet state
- switch (ord($recordData{4})) {
+ switch (ord($recordData[4])) {
case 0x00: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE; break;
case 0x01: $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN; break;
case 0x02: $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN; break;
@@ -2562,7 +2562,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
}
// offset: 5; size: 1; sheet type
- $sheetType = ord($recordData{5});
+ $sheetType = ord($recordData[5]);
// offset: 6; size: var; sheet name
if ($this->_version == self::XLS_BIFF8) {
@@ -2741,7 +2741,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// offset: 2; size: 1; keyboard shortcut
// offset: 3; size: 1; length of the name (character count)
- $nlen = ord($recordData{3});
+ $nlen = ord($recordData[3]);
// offset: 4; size: 2; size of the formula data (it can happen that this is zero)
// note: there can also be additional data, this is not included in $flen
@@ -3817,7 +3817,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true
// the formula data may be ordinary formula data, therefore we need to check
// explicitly for the tExp token (0x01)
- $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01;
+ $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure[2]) == 0x01;
if ($isPartOfSharedFormula) {
// part of shared formula which means there will be a formula with a tExp token and nothing else
@@ -3841,7 +3841,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xfIndex = self::_GetInt2d($recordData, 4);
// offset: 6; size: 8; result of the formula
- if ( (ord($recordData{6}) == 0)
+ if ( (ord($recordData[6]) == 0)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255) ) {
@@ -3857,23 +3857,23 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// read STRING record
$value = $this->_readString();
- } elseif ((ord($recordData{6}) == 1)
+ } elseif ((ord($recordData[6]) == 1)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255)) {
// Boolean formula. Result is in +2; 0=false, 1=true
$dataType = PHPExcel_Cell_DataType::TYPE_BOOL;
- $value = (bool) ord($recordData{8});
+ $value = (bool) ord($recordData[8]);
- } elseif ((ord($recordData{6}) == 2)
+ } elseif ((ord($recordData[6]) == 2)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255)) {
// Error formula. Error code is in +2
$dataType = PHPExcel_Cell_DataType::TYPE_ERROR;
- $value = self::_mapErrorCode(ord($recordData{8}));
+ $value = self::_mapErrorCode(ord($recordData[8]));
- } elseif ((ord($recordData{6}) == 3)
+ } elseif ((ord($recordData[6]) == 3)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255)) {
@@ -3943,7 +3943,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// offset: 6, size: 1; not used
// offset: 7, size: 1; number of existing FORMULA records for this shared formula
- $no = ord($recordData{7});
+ $no = ord($recordData[7]);
// offset: 8, size: var; Binary token array of the shared formula
$formula = substr($recordData, 8);
@@ -4010,10 +4010,10 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$xfIndex = self::_GetInt2d($recordData, 4);
// offset: 6; size: 1; the boolean value or error value
- $boolErr = ord($recordData{6});
+ $boolErr = ord($recordData[6]);
// offset: 7; size: 1; 0=boolean; 1=error
- $isError = ord($recordData{7});
+ $isError = ord($recordData[7]);
$cell = $this->_phpSheet->getCell($columnString . ($row + 1));
switch ($isError) {
@@ -4391,7 +4391,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
if (!$this->_readDataOnly) {
// offset: 0; size: 1; pane identifier
- $paneId = ord($recordData{0});
+ $paneId = ord($recordData[0]);
// offset: 1; size: 2; index to row of the active cell
$r = self::_GetInt2d($recordData, 1);
@@ -4411,17 +4411,17 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!)
if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) {
- $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells);
+ $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '$[1]1048576', $selectedCells);
}
// first row '1' + last row '65536' indicates that full column is selected
if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) {
- $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells);
+ $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '$[1]1048576', $selectedCells);
}
// first column 'A' + last column 'IV' indicates that full row is selected
if (preg_match('/^(A[0-9]+\:)IV([0-9]+)$/', $selectedCells)) {
- $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '${1}XFD${2}', $selectedCells);
+ $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '$[1]XFD$[2]', $selectedCells);
}
$this->_phpSheet->setSelectedCells($selectedCells);
@@ -6090,10 +6090,10 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$lr = self::_GetInt2d($subData, 2) + 1;
// offset: 4; size: 1; index to first column
- $fc = ord($subData{4});
+ $fc = ord($subData[4]);
// offset: 5; size: 1; index to last column
- $lc = ord($subData{5});
+ $lc = ord($subData[5]);
// check values
if ($fr > $lr || $fc > $lc) {
@@ -6500,13 +6500,13 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
private static function _readRGB($rgb)
{
// offset: 0; size 1; Red component
- $r = ord($rgb{0});
+ $r = ord($rgb[0]);
// offset: 1; size: 1; Green component
- $g = ord($rgb{1});
+ $g = ord($rgb[1]);
// offset: 2; size: 1; Blue component
- $b = ord($rgb{2});
+ $b = ord($rgb[2]);
// HEX notation, e.g. 'FF00FC'
$rgb = sprintf('%02X%02X%02X', $r, $g, $b);
diff --git a/core/class/PHPExcel/Reader/Excel5/MD5.php b/core/class/PHPExcel/Reader/Excel5/MD5.php
index 946d5a0..f7f515a 100644
--- a/core/class/PHPExcel/Reader/Excel5/MD5.php
+++ b/core/class/PHPExcel/Reader/Excel5/MD5.php
@@ -72,7 +72,7 @@ class PHPExcel_Reader_Excel5_MD5
{
$s = '';
foreach (array('a', 'b', 'c', 'd') as $i) {
- $v = $this->{$i};
+ $v = $this->[$i];
$s .= chr($v & 0xff);
$s .= chr(($v >> 8) & 0xff);
$s .= chr(($v >> 16) & 0xff);
diff --git a/core/class/PHPExcel/Reader/SYLK.php b/core/class/PHPExcel/Reader/SYLK.php
index cd87ce5..fc7b837 100644
--- a/core/class/PHPExcel/Reader/SYLK.php
+++ b/core/class/PHPExcel/Reader/SYLK.php
@@ -168,7 +168,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
if ($dataType == 'C') {
// Read cell value data
foreach($rowData as $rowDatum) {
- switch($rowDatum{0}) {
+ switch($rowDatum[0]) {
case 'C' :
case 'X' :
$columnIndex = substr($rowDatum,1) - 1;
@@ -257,7 +257,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
if ($dataType == 'P') {
$formatArray = array();
foreach($rowData as $rowDatum) {
- switch($rowDatum{0}) {
+ switch($rowDatum[0]) {
case 'P' : $formatArray['numberformat']['code'] = str_replace($fromFormats,$toFormats,substr($rowDatum,1));
break;
case 'E' :
@@ -267,7 +267,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
break;
case 'S' : $styleSettings = substr($rowDatum,1);
for ($i=0;$i
= PHPExcel_Cell::columnIndexFromString($beforeColumn));
- $updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') &&
+ $updateRow = (($newRow[0] != '$') && ($beforeRow[0] != '$') &&
$newRow >= $beforeRow);
// Create new column reference
diff --git a/core/class/PHPExcel/Shared/OLE.php b/core/class/PHPExcel/Shared/OLE.php
index 9796282..67fe0fb 100644
--- a/core/class/PHPExcel/Shared/OLE.php
+++ b/core/class/PHPExcel/Shared/OLE.php
@@ -447,7 +447,7 @@ class PHPExcel_Shared_OLE
{
$rawname = '';
for ($i = 0; $i < strlen($ascii); ++$i) {
- $rawname .= $ascii{$i} . "\x00";
+ $rawname .= $ascii[$i] . "\x00";
}
return $rawname;
}
diff --git a/core/class/PHPExcel/Shared/String.php b/core/class/PHPExcel/Shared/String.php
index 49d217a..57fc630 100644
--- a/core/class/PHPExcel/Shared/String.php
+++ b/core/class/PHPExcel/Shared/String.php
@@ -526,15 +526,15 @@ class PHPExcel_Shared_String
*/
public static function utf16_decode($str, $bom_be = TRUE) {
if( strlen($str) < 2 ) return $str;
- $c0 = ord($str{0});
- $c1 = ord($str{1});
+ $c0 = ord($str[0]);
+ $c1 = ord($str[1]);
if( $c0 == 0xfe && $c1 == 0xff ) { $str = substr($str,2); }
elseif( $c0 == 0xff && $c1 == 0xfe ) { $str = substr($str,2); $bom_be = false; }
$len = strlen($str);
$newstr = '';
for($i=0;$i<$len;$i+=2) {
- if( $bom_be ) { $val = ord($str{$i}) << 4; $val += ord($str{$i+1}); }
- else { $val = ord($str{$i+1}) << 4; $val += ord($str{$i}); }
+ if( $bom_be ) { $val = ord($str[$i]) << 4; $val += ord($str[$i+1]); }
+ else { $val = ord($str[$i+1]) << 4; $val += ord($str[$i]); }
$newstr .= ($val == 0x228) ? "\n" : chr($val);
}
return $newstr;
diff --git a/core/class/PHPExcel/Shared/ZipStreamWrapper.php b/core/class/PHPExcel/Shared/ZipStreamWrapper.php
index 696072b..22a0108 100644
--- a/core/class/PHPExcel/Shared/ZipStreamWrapper.php
+++ b/core/class/PHPExcel/Shared/ZipStreamWrapper.php
@@ -81,7 +81,7 @@ class PHPExcel_Shared_ZipStreamWrapper {
*/
public function stream_open($path, $mode, $options, &$opened_path) {
// Check for mode
- if ($mode{0} != 'r') {
+ if ($mode[0] != 'r') {
throw new PHPExcel_Reader_Exception('Mode ' . $mode . ' is not supported. Only read mode is supported.');
}
diff --git a/core/class/PHPExcel/Worksheet/AutoFilter.php b/core/class/PHPExcel/Worksheet/AutoFilter.php
index 03055e1..abde9ad 100644
--- a/core/class/PHPExcel/Worksheet/AutoFilter.php
+++ b/core/class/PHPExcel/Worksheet/AutoFilter.php
@@ -726,7 +726,7 @@ class PHPExcel_Worksheet_AutoFilter
);
} else {
// Date based
- if ($dynamicRuleType{0} == 'M' || $dynamicRuleType{0} == 'Q') {
+ if ($dynamicRuleType[0] == 'M' || $dynamicRuleType[0] == 'Q') {
// Month or Quarter
sscanf($dynamicRuleType,'%[A-Z]%d', $periodType, $period);
if ($periodType == 'M') {
diff --git a/core/class/PHPExcel/Writer/Excel5/Parser.php b/core/class/PHPExcel/Writer/Excel5/Parser.php
index 04e674a..3c2853d 100644
--- a/core/class/PHPExcel/Writer/Excel5/Parser.php
+++ b/core/class/PHPExcel/Writer/Excel5/Parser.php
@@ -549,7 +549,7 @@ class PHPExcel_Writer_Excel5_Parser
return pack("C", $this->ptg[$token]);
// match error codes
- } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A') {
+ } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?][1]$/", $token) or $token == '#N/A') {
return $this->_convertError($token);
// commented so argument number can be processed correctly. See toReversePolish().
@@ -1021,7 +1021,7 @@ class PHPExcel_Writer_Excel5_Parser
$col = 0;
$col_ref_length = strlen($col_ref);
for ($i = 0; $i < $col_ref_length; ++$i) {
- $col += (ord($col_ref{$i}) - 64) * pow(26, $expn);
+ $col += (ord($col_ref[$i]) - 64) * pow(26, $expn);
--$expn;
}
@@ -1043,28 +1043,28 @@ class PHPExcel_Writer_Excel5_Parser
$formula_length = strlen($this->_formula);
// eat up white spaces
if ($i < $formula_length) {
- while ($this->_formula{$i} == " ") {
+ while ($this->_formula[$i] == " ") {
++$i;
}
if ($i < ($formula_length - 1)) {
- $this->_lookahead = $this->_formula{$i+1};
+ $this->_lookahead = $this->_formula[$i+1];
}
$token = '';
}
while ($i < $formula_length) {
- $token .= $this->_formula{$i};
+ $token .= $this->_formula[$i];
if ($i < ($formula_length - 1)) {
- $this->_lookahead = $this->_formula{$i+1};
+ $this->_lookahead = $this->_formula[$i+1];
} else {
$this->_lookahead = '';
}
if ($this->_match($token) != '') {
//if ($i < strlen($this->_formula) - 1) {
- // $this->_lookahead = $this->_formula{$i+1};
+ // $this->_lookahead = $this->_formula[$i+1];
//}
$this->_current_char = $i + 1;
$this->_current_token = $token;
@@ -1175,7 +1175,7 @@ class PHPExcel_Writer_Excel5_Parser
return $token;
}
// If it's an error code
- elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $token) or $token == '#N/A')
+ elseif (preg_match("/^#[A-Z0\/]{3,5}[!?][1]$/", $token) or $token == '#N/A')
{
return $token;
}
@@ -1205,7 +1205,7 @@ class PHPExcel_Writer_Excel5_Parser
{
$this->_current_char = 0;
$this->_formula = $formula;
- $this->_lookahead = isset($formula{1}) ? $formula{1} : '';
+ $this->_lookahead = isset($formula[1]) ? $formula[1] : '';
$this->_advance();
$this->_parse_tree = $this->_condition();
return true;
@@ -1274,7 +1274,7 @@ class PHPExcel_Writer_Excel5_Parser
$this->_advance();
return $result;
// If it's an error code
- } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?]{1}$/", $this->_current_token) or $this->_current_token == '#N/A'){
+ } elseif (preg_match("/^#[A-Z0\/]{3,5}[!?][1]$/", $this->_current_token) or $this->_current_token == '#N/A'){
$result = $this->_createTree($this->_current_token, 'ptgErr', '');
$this->_advance();
return $result;
diff --git a/core/class/PHPExcel/Writer/Excel5/Workbook.php b/core/class/PHPExcel/Writer/Excel5/Workbook.php
index e14bcba..8f31098 100644
--- a/core/class/PHPExcel/Writer/Excel5/Workbook.php
+++ b/core/class/PHPExcel/Writer/Excel5/Workbook.php
@@ -675,7 +675,7 @@ class PHPExcel_Writer_Excel5_Workbook extends PHPExcel_Writer_Excel5_BIFFwriter
$formulaData = $this->_parser->toReversePolish();
// make sure tRef3d is of type tRef3dR (0x3A)
- if (isset($formulaData{0}) and ($formulaData{0} == "\x7A" or $formulaData{0} == "\x5A")) {
+ if (isset($formulaData[0]) and ($formulaData[0] == "\x7A" or $formulaData[0] == "\x5A")) {
$formulaData = "\x3A" . substr($formulaData, 1);
}
diff --git a/core/class/PHPExcel/Writer/Excel5/Worksheet.php b/core/class/PHPExcel/Writer/Excel5/Worksheet.php
index 55da26f..bf2311f 100644
--- a/core/class/PHPExcel/Writer/Excel5/Worksheet.php
+++ b/core/class/PHPExcel/Writer/Excel5/Worksheet.php
@@ -904,7 +904,7 @@ class PHPExcel_Writer_Excel5_Worksheet extends PHPExcel_Writer_Excel5_BIFFwriter
$unknown = 0x0000; // Must be zero
// Strip the '=' or '@' sign at the beginning of the formula string
- if ($formula{0} == '=') {
+ if ($formula[0] == '=') {
$formula = substr($formula,1);
} else {
// Error handling
diff --git a/core/class/cache/cache_file.php b/core/class/cache/cache_file.php
index 3c964ff..5aca998 100644
--- a/core/class/cache/cache_file.php
+++ b/core/class/cache/cache_file.php
@@ -67,7 +67,7 @@ class ultrax_cache {
function get_cache_file_path($key) {
static $cache_path = null;
if(!isset($cache_path[$key])) {
- $dir = hexdec($key{0}.$key{1}.$key{2}) % 1000;
+ $dir = hexdec($key[0].$key[1].$key[2]) % 1000;
$cache_path[$key] = $this->conf['path'].'/'.$dir.'/'.$key.'.php';
}
return $cache_path[$key];
diff --git a/core/class/class_Chinese.php b/core/class/class_Chinese.php
index b5ddf99..1228cc4 100644
--- a/core/class/class_Chinese.php
+++ b/core/class/class_Chinese.php
@@ -64,6 +64,9 @@ class Chinese {
} elseif($this->config['SourceLang'] == 'BIG5' || $this->config['TargetLang'] == 'BIG5') {
$this->table = CODETABLE_DIR.$this->config['BIG5toUnicode_table'];
}
+ if(!$this->table) {
+ return;
+ }
$fp = fopen($this->table, 'rb');
$tabletmp = fread($fp, filesize($this->table));
for($i = 0; $i < strlen($tabletmp); $i += 4) {
diff --git a/core/class/class_FileDownload.php b/core/class/class_FileDownload.php
index ba2859c..92a22bd 100644
--- a/core/class/class_FileDownload.php
+++ b/core/class/class_FileDownload.php
@@ -20,9 +20,12 @@ class FileDownload{ // class start
* @param boolean $reload 是否开启断点续传
*/
public function download($file, $name='',$file_size=0,$dateline=0, $reload=false){
- if($name==''){
- $name = basename($file);
- }
+ if (is_array($file) && isset($file['error'])) {
+ topshowmessage(lang('file_not_exist1'));
+ }
+ if($name==''){
+ $name = basename($file);
+ }
if(!$dateline){
$dataline=TIMESTAMP;
}
@@ -35,12 +38,21 @@ class FileDownload{ // class start
if(getglobal('gzipcompress')) @ob_start('ob_gzhandler');
if(!$file_size) $file_size = filesize($file);
$ranges = $this->getRange($file_size);
-
- header('cache-control:public');
- header('Date: '.gmdate('D, d M Y H:i:s', $dateline).' GMT');
- header('Last-Modified: '.gmdate('D, d M Y H:i:s', $dateline).' GMT');
- header('content-type:application/octet-stream');
- header('content-disposition:attachment; filename='.$name);
+ $charset = CHARSET;
+ header('cache-control:public');
+ header('Date: '.gmdate('D, d M Y H:i:s', $dateline).' GMT');
+ header('Last-Modified: '.gmdate('D, d M Y H:i:s', $dateline).' GMT');
+ header('content-type:application/octet-stream');
+ if (preg_match("/Firefox/", $_SERVER["HTTP_USER_AGENT"])) {
+ $attachment = 'attachment; filename*='.$charset.'\'\'' . $name;
+ } elseif (!preg_match("/Chrome/", $_SERVER["HTTP_USER_AGENT"]) && preg_match("/Safari/", $_SERVER["HTTP_USER_AGENT"])) {
+ $name = trim($name,'"');
+ $filename = rawurlencode($name); // 注意:rawurlencode与urlencode的区别
+ $attachment = 'attachment; filename*='.$charset.'\'\'' . $filename;
+ } else{
+ $attachment = 'attachment; filename='.$name;
+ }
+ header('content-disposition:'.$attachment);
if($reload && $ranges!=null){ // 使用续传
header('HTTP/1.1 206 Partial Content');
header('Accept-Ranges:bytes');
diff --git a/core/class/class_GifMerge.php b/core/class/class_GifMerge.php
index b4000b6..20c08d7 100644
--- a/core/class/class_GifMerge.php
+++ b/core/class/class_GifMerge.php
@@ -3,7 +3,6 @@
if(!defined('IN_DZZ')) {
exit('Access Denied');
}
-
class GifMerge {
var $ver = '1.1';
var $dly = 50;
@@ -286,7 +285,7 @@ class GifMerge {
function arrcmp($b, $s, $l) {
for($i = 0; $i < $l; $i++) {
- if($s{$i} != $b{$i}) {
+ if($s[$i] != $b[$i]) {
return false;
}
}
diff --git a/core/class/class_core.php b/core/class/class_core.php
index 6f7db91..f6d7ebe 100644
--- a/core/class/class_core.php
+++ b/core/class/class_core.php
@@ -2,6 +2,7 @@
if(!defined('IN_DZZ')) {
exit('Access Denied');
}
+
class core
{
private static $_tables;
@@ -104,7 +105,10 @@ class core
}
public static function import($name, $folder = '', $force = true) {
-
+ //如果文件名为空或者false,阻止向下进行
+ if(preg_match('/^\s*$/',$name) || $name == false){
+ return false;
+ }
$key = $folder.$name;
if(!isset(self::$_imports[$key])) {
if($folder){
diff --git a/core/class/class_image.php b/core/class/class_image.php
index a4754cf..eaba0de 100644
--- a/core/class/class_image.php
+++ b/core/class/class_image.php
@@ -181,6 +181,10 @@ class image {
$this->imagecreatefromfunc = function_exists('imagecreatefrompng') ? 'imagecreatefrompng' : '';
$this->imagefunc = function_exists('imagepng') ? 'imagepng' : '';
break;
+ case 'image/webp':
+ $this->imagecreatefromfunc = function_exists('imagecreatefromwebp') ? 'imagecreatefromwebp' : '';
+ $this->imagefunc = function_exists('imagewebp') ? 'imagewebp' : '';
+ break;
}
} else {
$this->imagecreatefromfunc = $this->imagefunc = TRUE;
@@ -196,6 +200,20 @@ class image {
$content = fread($fp, $this->imginfo['size']);
fclose($fp);
$this->imginfo['animated'] = strpos($content, 'NETSCAPE2.0') === FALSE ? 0 : 1;
+ } elseif(!$this->libmethod && $this->imginfo['mime'] == 'image/webp') {
+ if(!$this->imagecreatefromfunc) {
+ return -4;
+ }
+ if(!($fp = @fopen($source, 'rb'))) {
+ return -2;
+ }
+ $content = fread($fp, 40);
+ fclose($fp);
+ if (stripos($content, 'WEBPVP8X') !== FALSE && stripos($content, 'ANIM') !== FALSE) {
+ $this->imginfo['animated'] = 1;
+ }else{
+ $this->imginfo['animated'] = 0;
+ }
}
return $this->imagecreatefromfunc ? 1 : -4;
@@ -277,9 +295,11 @@ class image {
return $attach_photo;
}
//@ini_set('memory_limit','512M');
- $copy_photo = imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']);
- imagecopy($copy_photo, $attach_photo ,0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']);
- $attach_photo = $copy_photo;
+ if($this->imginfo['mime'] != 'image/png') {
+ $copy_photo = imagecreatetruecolor($this->imginfo['width'], $this->imginfo['height']);
+ imagecopy($copy_photo, $attach_photo , 0, 0, 0, 0, $this->imginfo['width'], $this->imginfo['height']);
+ $attach_photo = $copy_photo;
+ }
$thumb_photo = null;
switch($this->param['thumbtype']) {
@@ -291,6 +311,10 @@ class image {
$cx = $this->imginfo['width'];
$cy = $this->imginfo['height'];
$thumb_photo = imagecreatetruecolor($thumb['width'], $thumb['height']);
+ if($this->imginfo['mime'] == 'image/png') {
+ imagealphablending($thumb_photo, false);
+ imagesavealpha($thumb_photo, true);
+ }
imagecopyresampled($thumb_photo, $attach_photo ,0, 0, 0, 0, $thumb['width'], $thumb['height'], $cx, $cy);
}
break;
@@ -301,9 +325,17 @@ class image {
$dst_photo = imagecreatetruecolor($cutw, $cuth);
imagecopymerge($dst_photo, $attach_photo, 0, 0, $startx, $starty, $cutw, $cuth, 100);
$thumb_photo = imagecreatetruecolor($this->param['thumbwidth'], $this->param['thumbheight']);
+ if($this->imginfo['mime'] == 'image/png') {
+ imagealphablending($thumb_photo, false);
+ imagesavealpha($thumb_photo, true);
+ }
imagecopyresampled($thumb_photo, $dst_photo ,0, 0, 0, 0, $this->param['thumbwidth'], $this->param['thumbheight'], $cutw, $cuth);
} else {
$thumb_photo = imagecreatetruecolor($this->param['thumbwidth'], $this->param['thumbheight']);
+ if($this->imginfo['mime'] == 'image/png') {
+ imagealphablending($thumb_photo, false);
+ imagesavealpha($thumb_photo, true);
+ }
$bgcolor = imagecolorallocate($thumb_photo, 255, 255, 255);
imagefill($thumb_photo, 0, 0, $bgcolor);
$startx = ($this->param['thumbwidth'] - $this->imginfo['width']) / 2;
@@ -357,9 +389,9 @@ class image {
$im->readImage(realpath($this->target));
$im->setImageCompressionQuality($this->param['thumbquality']);
$im->thumbnailImage($this->param['thumbwidth'], $this->param['thumbheight']);
- $im->resizeImage($this->param['thumbwidth'], $this->param['thumbheight']);
+ $im->resizeImage($this->param['thumbwidth'], $this->param['thumbheight'], imagick::FILTER_LANCZOS, 1, true);
$im->setGravity(imagick::GRAVITY_CENTER );
- $im->extentImage($this->param['thumbwidth'], $this->param['thumbheight']);
+ $im->extentImage($this->param['thumbwidth'], $this->param['thumbheight'], 0, 0);
if(!$im->writeImage($this->target)) {
$im->destroy();
@@ -383,7 +415,7 @@ class image {
$im->setImageCompressionQuality($this->param['thumbquality']);
$im->thumbnailImage($this->param['thumbwidth'], $this->param['thumbheight']);
$im->setGravity(imagick::GRAVITY_CENTER );
- $im->extentImage($this->param['thumbwidth'], $this->param['thumbheight']);
+ $im->extentImage($this->param['thumbwidth'], $this->param['thumbheight'], 0, 0);
if(!$im->writeImage($this->target)) {
$im->destroy();
return -3;
diff --git a/core/class/class_pinyin.php b/core/class/class_pinyin.php
index 5df51c8..fc977c0 100644
--- a/core/class/class_pinyin.php
+++ b/core/class/class_pinyin.php
@@ -46,9 +46,9 @@ class pinyin {
$sGBK = iconv('UTF-8', 'GBK', $utf8Data);
$aBuf = array();
for ($i=0, $iLoop=strlen($sGBK); $i<$iLoop; $i++) {
- $iChr = ord($sGBK{$i});
+ $iChr = ord($sGBK[$i]);
if ($iChr>160)
- $iChr = ($iChr<<8) + ord($sGBK{++$i}) - 65536;
+ $iChr = ($iChr<<8) + ord($sGBK[++$i]) - 65536;
if ('head' === $sRetFormat)
$aBuf[] = substr(self::zh2py($iChr),0,1);
else
diff --git a/core/class/class_template.php b/core/class/class_template.php
index 8acdc44..00e7603 100644
--- a/core/class/class_template.php
+++ b/core/class/class_template.php
@@ -97,21 +97,41 @@ class template {
}
//解析模板路径
private function parse_tplfile($tplfile, $tpldir = '',$master_template = false,$nomasttplfile = false){
- if(!$tpldir){
- if( defined('CURSCRIPT') && defined('CURMODULE') && file_exists (DZZ_ROOT.'./'.CURSCRIPT.'/'.CURMODULE.'/template/'.$tplfile.'.htm')){
- $tpldir= './'.CURSCRIPT.'/'.CURMODULE.'/template/';
- if($master_template)$this->tplkey=CURSCRIPT.'_'.str_replace('/','_',CURMODULE);
- }elseif(defined('CURSCRIPT') && file_exists (DZZ_ROOT.'./'.CURSCRIPT.'/template/'.$tplfile.'.htm')){
- $tpldir= './'.CURSCRIPT.'/template/';
- if($master_template)$this->tplkey=CURSCRIPT;
- }elseif(file_exists (DZZ_ROOT.'./core/template/default/'.$tplfile.'.htm')){
- $tpldir= './core/template/default/';
- if($master_template)$this->tplkey='core';
- }elseif(file_exists (DZZ_ROOT.'./core/template/default/common/'.$tplfile.'.htm')){
- $tpldir= './core/template/default/common/';
- if($master_template)$this->tplkey='corecommon';
- }
- }
+ if ($tpldir) {
+ if (strpos($tpldir, '/') !== false) {
+ $tpldirkey = str_replace('/', '_', $tpldir);
+ }else{
+ $tpldirkey = $tpldir;
+ }
+ }
+ if($tpldir && defined('CURSCRIPT') && defined('CURMODULE') && file_exists (DZZ_ROOT.'./'.CURSCRIPT.'/'.CURMODULE.'/template/'.$tpldir.'/'.$tplfile.'.htm')){
+ $tpldir= './'.CURSCRIPT.'/'.CURMODULE.'/template/'.$tpldir.'/';
+ if($master_template)$this->tplkey=CURSCRIPT.'_'.str_replace('/','_',CURMODULE).'_'.$tpldirkey;
+ }elseif(defined('CURSCRIPT') && defined('CURMODULE') && file_exists (DZZ_ROOT.'./'.CURSCRIPT.'/'.CURMODULE.'/template/'.$tplfile.'.htm')){
+ $tpldir= './'.CURSCRIPT.'/'.CURMODULE.'/template/';
+ if($master_template)$this->tplkey=CURSCRIPT.'_'.str_replace('/','_',CURMODULE);
+ }elseif($tpldir && defined('CURSCRIPT') && file_exists (DZZ_ROOT.'./'.CURSCRIPT.'/template/'.$tpldir.'/'.$tplfile.'.htm')){
+ $tpldir= './'.CURSCRIPT.'/template/'.$tpldir.'/';
+ if($master_template)$this->tplkey=CURSCRIPT.'_'.$tpldirkey;
+ }elseif(defined('CURSCRIPT') && file_exists (DZZ_ROOT.'./'.CURSCRIPT.'/template/'.$tplfile.'.htm')){
+ $tpldir= './'.CURSCRIPT.'/template/';
+ if($master_template)$this->tplkey=CURSCRIPT;
+ }elseif($tpldir && file_exists (DZZ_ROOT.'./core/template/'.$tpldir.'/'.$tplfile.'.htm')){
+ $tpldir= './core/template/'.$tpldir.'/';
+ if($master_template)$this->tplkey='core'.'_'.$tpldirkey;
+ }elseif($tpldir && file_exists (DZZ_ROOT.'./core/template/'.$tpldir.'/common/'.$tplfile.'.htm')){
+ $tpldir= './core/template/'.$tpldir.'/common/';
+ if($master_template)$this->tplkey='corecommon'.'_'.$tpldirkey;
+ }elseif(file_exists (DZZ_ROOT.'./core/template/'.$tplfile.'.htm')){
+ $tpldir= './core/template/';
+ if($master_template)$this->tplkey='core';
+ }elseif(file_exists (DZZ_ROOT.'./core/template/default/'.$tplfile.'.htm')){
+ $tpldir= './core/template/default/';
+ if($master_template)$this->tplkey='core';
+ }elseif(file_exists (DZZ_ROOT.'./core/template/default/common/'.$tplfile.'.htm')){
+ $tpldir= './core/template/default/common/';
+ if($master_template)$this->tplkey='corecommon';
+ }
$file = $tplfile;
$tplfile = $tpldir.$tplfile.'.htm';
$basefile = basename(DZZ_ROOT . $tplfile, '.htm');
@@ -134,7 +154,13 @@ class template {
}
//读取模板内容
private function parse_template_include($tpl){
- $template = $this->parse_tplfile($tpl,'',false,true);
+ global $_G;
+ if(strpos($tpl, ':') !== false) {
+ list($templateid, $tpl) = explode(':', $tpl);
+ $tpldir = $templateid;
+ $tpl = $tpl;
+ }
+ $template = $this->parse_tplfile($tpl,$tpldir,false,true);
$this->includeTemplate[$template] = filemtime($template);
if(!is_file($template) || !$fp = fopen($template, 'r')){
return;
@@ -147,9 +173,7 @@ class template {
$template = str_replace('self.$', 'self.$', $template);
$var_regexp = "((?!\\\$[a-zA-Z]+\()(\\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\-\>)?[a-zA-Z0-9_\x7f-\xff]*)(\[[a-zA-Z0-9_\-\.\"\'\[\]\$\x7f-\xff]+\])*)";
$const_regexp = "([A-Z_\x7f-\xff][A-Z0-9_\x7f-\xff]*)";
-
$template = preg_replace("/([\n\r]+)\t+/s", "\\1", $template);
-
$template = preg_replace("/\<\!\-\-\{(.+?)\}\-\-\>/s", "{\\1}", $template);
// js的lang替换
$template = preg_replace_callback("/";
+
+ if(!defined('IN_ADMINCP') && file_exists(DZZ_ROOT.'./static/image/common/temp-grid.png')) $debug .= <<
+var s = '网格 ';
+s += '
';
+top.document.getElementById('_debug_div').innerHTML = s;
+
+EOF;
+
+ $_GS = $_GA = '';
+ if($_G['adminid'] == 1) {
+ foreach($_G as $k => $v) {
+ if(is_array($v)) {
+ if($k != 'lang') {
+ $_GA .= " ['$k'] => ".nl2br(str_replace(' ',' ', dhtmlspecialchars(print_r($v, true)))).' ';
+ }
+ } elseif(is_object($v)) {
+ $_GA .= "['$k'] => object of ".get_class($v)." ";
+ } else {
+ $_GS .= "['$k'] => ".dhtmlspecialchars($v)." ";
+ }
+ }
+ }
+ $modid = $_G['basescript'].(!defined('IN_ADMINCP') ? '::'.CURMODULE : '');
+ $svn = '';
+ if(file_exists(DZZ_ROOT.'./.svn/entries')) {
+ $svn = @file(DZZ_ROOT.'./.svn/entries');
+ $time = $svn[9];
+ preg_match('/([\d\-]+)T([\d:]+)/', $time, $a);
+ $svn = '.r'.$svn[10].' (最后由 '.$svn[11].' 于 '.dgmdate(strtotime($a[1].' '.$a[2]) + $_G['setting']['timeoffset'] * 3600).' 提交)';
+ }
+ $max = 10;
+ $mc = $mco = '';
+ if(class_exists('C') && C::memory()->enable) {
+ $mcarray = C::memory()->debug;
+ $i = 0;
+ $max += count($mcarray);
+ foreach($mcarray as $key => $value) {
+ $mco .= '';
+ $mc .= '['.$key.'] '.($value ? '('.count($value).') ' : '');
+ $i++;
+ }
+ }
+ $debug .= '
+
+
+ '.
+ ''.
+ '
'.
+ '
'.
+ '
Queries: '.$queries.'
';
+ $debug .= $sqldebug.'';
+ $debug .= ' '.
+ '
'.
+ '
IP: '.$_G['clientip'].'User Agent: '.$_SERVER['HTTP_USER_AGENT'].'BROWSER.x:
'.
+ '
';
+ foreach ($includes as $fn) {
+ $fn = str_replace(array(DZZ_ROOT, "\\"), array('', '/'), $fn);
+ $debug .= '';
+ if(preg_match('/^dzz\//', $fn)) {
+ $debug .= '[插件]';
+ } elseif(preg_match('/^admin\//', $fn)) {
+ $debug .= '[管理页]';
+ } elseif(preg_match('/^core\//', $fn)) {
+ $debug .= '[脚本]';
+ } elseif(preg_match('/^data\/template\//', $fn)) {
+ $debug .= '[模板]';
+ } elseif(preg_match('/^data/', $fn)) {
+ $debug .= '[缓存]';
+ } elseif(preg_match('/^config/', $fn)) {
+ $debug .= '[配置]';
+ }
+ if(isset($_ENV['analysis']['file'][$fn]['time'])) {
+ $time = ' ('.$_ENV['analysis']['file'][$fn]['time'].'ms )';
+ $debug .= ''.$fn.$time.' ';
+ } else {
+ $debug .= $fn;
+ }
+ if(isset($_ENV['analysis']['file'][$fn])) {
+ memory_info($debug, $fn, $_ENV['analysis']['file'][$fn]);
+ } else {
+ memory_info($debug, $fn, array('start_memory_get_usage' => 0, 'stop_memory_get_usage' => 0, 'start_memory_get_real_usage' => 0, 'stop_memory_get_real_usage' => 0,'start_memory_get_peak_usage' => 0, 'stop_memory_get_peak_usage' => 0, 'start_memory_get_peak_real_usage' => 0, 'stop_memory_get_peak_real_usage' => 0));
+ }
+ $debug .= ' ';
+ }
+ if(isset($_ENV['analysis']['file']['sum'])) {
+ $debug .= 'count: '.($_ENV['analysis']['file']['sum']/1000).'s ';
+ }
+ $debug .= ' ';
+ foreach($_COOKIE as $k => $v) {
+ if(strexists($k, $_G['config']['cookie']['cookiepre'])) {
+ $k = ''.$k.' ';
+ }
+ $debug .= "['$k'] => ".dhtmlspecialchars($v)." ";
+ }
+ if(isset($_ENV['analysis']['function'])) {
+ unset($_ENV['analysis']['function']['sum']);
+ $debug .= ' ';
+ foreach($_ENV['analysis']['function'] as $_fn => $function) {
+ $debug .= ' ';
+ $debug .= ''.$_fn.' ('.$function['time'].'ms )';
+ memory_info($debug, $_fn, $function);
+ $debug .= ' ';
+ }
+ }
+ $debug .= ' '.
+ '
'.
+ '
'.$_GS.$_GA.' '.$mco.'