From f398db053d111bbd404604c8cd39c68adb058083 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 18 Mar 2020 16:47:41 +0800 Subject: [PATCH 1/6] * code for task #6994. --- xuanxuan/module/message/ext/model/class/xuanxuan.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php index 723117c375..812c3366e6 100644 --- a/xuanxuan/module/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/module/message/ext/model/class/xuanxuan.class.php @@ -19,7 +19,7 @@ class xuanxuanMessage extends messageModel $server = $this->loadModel('im')->getServer('zentao'); $onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : ''; unset($_GET['onlybody']); - $url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'xhtml'); + $url = $server . helper::createLink($objectType, 'view', "id=$objectID", 'html'); $url = "xxc:openInApp/zentao-integrated/" . urlencode($url); $target = ''; From 9e83e6399616db5d07da516021bda9f14faf4d70 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 18 Mar 2020 16:48:14 +0800 Subject: [PATCH 2/6] * code for php7.4. --- framework/base/router.class.php | 2 +- lib/purifier/HTMLPurifier/ChildDef/Custom.php | 2 +- lib/purifier/HTMLPurifier/TagTransform/Font.php | 2 +- lib/scm/gitrepo.class.php | 6 +++--- lib/scm/subversion.class.php | 2 +- module/common/model.php | 4 ++-- module/common/view/footer.html.php | 2 +- module/file/model.php | 2 +- module/git/model.php | 4 ++-- module/tree/model.php | 2 +- www/index.php | 2 +- www/upgrade.php.tmp | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/framework/base/router.class.php b/framework/base/router.class.php index ed768a633a..10604d95a2 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -1378,7 +1378,7 @@ class baseRouter if(empty($extFiles) and empty($hookFiles)) return $mainModelFile; /* 计算合并之后的modelFile路径。Compute the merged model file path. */ - $extModelPrefix = ($siteExtended and !empty($this->siteCode)) ? $this->siteCode{0} . DS . $this->siteCode : ''; + $extModelPrefix = ($siteExtended and !empty($this->siteCode)) ? $this->siteCode[0] . DS . $this->siteCode : ''; $mergedModelDir = $this->getTmpRoot() . 'model' . DS . ($extModelPrefix ? $extModelPrefix . DS : ''); $mergedModelFile = $mergedModelDir . $moduleName . '.php'; if(!is_dir($mergedModelDir)) mkdir($mergedModelDir, 0755, true); diff --git a/lib/purifier/HTMLPurifier/ChildDef/Custom.php b/lib/purifier/HTMLPurifier/ChildDef/Custom.php index 1047cd8e8b..cc84d89908 100644 --- a/lib/purifier/HTMLPurifier/ChildDef/Custom.php +++ b/lib/purifier/HTMLPurifier/ChildDef/Custom.php @@ -45,7 +45,7 @@ class HTMLPurifier_ChildDef_Custom extends HTMLPurifier_ChildDef protected function _compileRegex() { $raw = str_replace(' ', '', $this->dtd_regex); - if ($raw{0} != '(') { + if ($raw[0] != '(') { $raw = "($raw)"; } $el = '[#a-zA-Z0-9_.-]+'; diff --git a/lib/purifier/HTMLPurifier/TagTransform/Font.php b/lib/purifier/HTMLPurifier/TagTransform/Font.php index 2a186515e2..99e01658cc 100644 --- a/lib/purifier/HTMLPurifier/TagTransform/Font.php +++ b/lib/purifier/HTMLPurifier/TagTransform/Font.php @@ -75,7 +75,7 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform if (isset($attr['size'])) { // normalize large numbers if ($attr['size'] !== '') { - if ($attr['size']{0} == '+' || $attr['size']{0} == '-') { + if ($attr['size'][0] == '+' || $attr['size'][0] == '-') { $size = (int)$attr['size']; if ($size < -2) { $attr['size'] = '-2'; diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index 2478569f16..304c9dbce3 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -124,7 +124,7 @@ class GitRepo $branches = array(); foreach($list as $localBranch) { - if($localBranch{0} == '*') $localBranch = substr($localBranch, 1); + if($localBranch[0] == '*') $localBranch = substr($localBranch, 1); $localBranch = trim($localBranch); if(empty($localBranch))continue; @@ -216,7 +216,7 @@ class GitRepo foreach($list as $line) { if(empty($line)) continue; - if($line{0} == '^') $line = substr($line, 1); + if($line[0] == '^') $line = substr($line, 1); preg_match('/^([0-9a-f]{39,40})\s.*\((\S+)\s+([\d-]+)\s(.*)\s(\d+)\)(.*)$/U', $line, $matches); if(isset($matches[1]) and $matches[1] != $revision) @@ -385,7 +385,7 @@ class GitRepo $line = $lines[$i]; if(strpos($line, '\ No newline at end of file') === 0)continue; - $sign = empty($line) ? '' : $line{0}; + $sign = empty($line) ? '' : $line[0]; if($sign == '-' and $newFile) $sign = '+'; $type = $sign != '-' ? $sign == '+' ? 'new' : 'all' : 'old'; if($sign == '-' || $sign == '+') diff --git a/lib/scm/subversion.class.php b/lib/scm/subversion.class.php index 02e80e8efa..5eb5b3a63f 100644 --- a/lib/scm/subversion.class.php +++ b/lib/scm/subversion.class.php @@ -447,7 +447,7 @@ class Subversion $line = $lines[$i]; if(strpos($line, '\ No newline at end of file') === 0)continue; - $sign = empty($line) ? '' : $line{0}; + $sign = empty($line) ? '' : $line[0]; $type = $sign != '-' ? $sign == '+' ? 'new' : 'all' : 'old'; if($sign == '-' || $sign == '+') $line = substr_replace($line, ' ', 1, 0); diff --git a/module/common/model.php b/module/common/model.php index 81d73d047f..d7e3093493 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -254,7 +254,7 @@ class commonModel extends model { echo '
  • '; @@ -1766,7 +1766,7 @@ EOD; { $timestamp = $queryString['time']; if(strlen($timestamp) > 10) $timestamp = substr($timestamp, 0, 10); - if(strlen($timestamp) != 10 or $timestamp{0} >= '4') $this->response('ERROR_TIMESTAMP'); + if(strlen($timestamp) != 10 or $timestamp[0] >= '4') $this->response('ERROR_TIMESTAMP'); $result = $this->get->token == md5($entry->code . $entry->key . $queryString['time']); if($result) diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php index 68cec35337..79f40320d2 100755 --- a/module/common/view/footer.html.php +++ b/module/common/view/footer.html.php @@ -22,7 +22,7 @@ $.initSidebar();
    loadModel('score')->getNotice(); ?>