Score
0
Watch 772 Star 2.3K Fork 1.2K

Discuz! / DiscuzXPHP

Merged
!487 修复 使用花括号做数组被废弃导致在部分服务器配置下产生提示信息导致程序功能异常的Bug

老周部落:PR_Fix_Deprecated_Curly_Braces Discuz!:master

老周部落 Created on: 2020-05-15 21:16
bug

根据PHP 7.4文档,使用花括号做数组下标的功能已在PHP 7.4废弃,在部分未关闭display_error的服务器上,会产生针对此信息的报错,因此此修复转为Bug,并改为在Master上修复。

本PR使用 https://github.com/FriendsOfPHP/PHP-CS-Fixer 工具对代码进行了扫描,并对相关代码并进行了修改。

Ref:
https://www.php.net/manual/en/migration74.deprecated.php

Issue:
#I1FWW5: Meta Issue: PHP8支持

0 comments, 1 participants 1773794 laozhoubuluo 1578959614

Show action logs Hide action logs
oldhuhu merged Pull Request 2020-05-18 16:53
oldhuhu check passed 2020-05-18 16:53
老周部落 updated description 2020-05-15 21:20
老周部落 set priority to Secondary 2020-05-15 21:19
老周部落 added label bug 2020-05-15 21:19
老周部落 assigned reviewer 湖中沉 2020-05-15 21:16
老周部落 assigned reviewer oldhuhu 2020-05-15 21:16
老周部落 assigned reviewer monkeye 2020-05-15 21:16
老周部落 assigned reviewer Discuz! 2020-05-15 21:16
老周部落 assigned reviewer LooTan 2020-05-15 21:16
老周部落 assigned reviewer comsenz-service 2020-05-15 21:16
老周部落 assigned reviewer DiscuzX 2020-05-15 21:16

Sign in to comment

2020-04-16

(1)
upload/source/admincp/admincp_checktools.php
@@ -303,7 +303,7 @@ if($operation == 'filecheck') {
$settings['ftp'] = C::t('common_setting')->fetch('ftp', true);
$settings['ftp']['password'] = authcode($settings['ftp']['password'], 'DECODE', md5($_G['config']['security']['authkey']));
$pwlen = strlen($settingnew['ftp']['password']);
if($settingnew['ftp']['password']{0} == $settings['ftp']['password']{0} && $settingnew['ftp']['password']{$pwlen - 1} == $settings['ftp']['password']{strlen($settings['ftp']['password']) - 1} && substr($settingnew['ftp']['password'], 1, $pwlen - 2) == '********') {
if($settingnew['ftp']['password'][0] == $settings['ftp']['password'][0] && $settingnew['ftp']['password'][$pwlen - 1] == $settings['ftp']['password'][strlen($settings['ftp']['password']) - 1] && substr($settingnew['ftp']['password'], 1, $pwlen - 2) == '********') {
$settingnew['ftp']['password'] = $settings['ftp']['password'];
}
$settingnew['ftp']['password'] = authcode($settingnew['ftp']['password'], 'ENCODE', md5($_G['config']['security']['authkey']));
@@ -347,7 +347,7 @@ if($operation == 'filecheck') {
$settingnew['mail']['smtp'] = array();
foreach($oldsmtp as $id => $value) {
if((empty($deletesmtp) || !in_array($id, $deletesmtp)) && !empty($value['server']) && !empty($value['port'])) {
$passwordmask = $oldmail['smtp'][$id]['auth_password'] ? $oldmail['smtp'][$id]['auth_password']{0}.'********'.substr($oldmail['smtp'][$id]['auth_password'], -2) : '';
$passwordmask = $oldmail['smtp'][$id]['auth_password'] ? $oldmail['smtp'][$id]['auth_password'][0].'********'.substr($oldmail['smtp'][$id]['auth_password'], -2) : '';
$value['auth_password'] = $value['auth_password'] == $passwordmask ? $oldmail['smtp'][$id]['auth_password'] : $value['auth_password'];
$settingnew['mail']['smtp'][] = $value;
}
upload/source/admincp/admincp_ec.php
@@ -63,7 +63,7 @@ if($operation == 'alipay') {
}
list($ec_contract, $ec_securitycode, $ec_partner, $ec_creditdirectpay) = explode("\t", authcode($settings['ec_contract'], 'DECODE', $_G['config']['security']['authkey']));
$ec_securitycodemask = $ec_securitycode ? $ec_securitycode{0}.'********'.substr($ec_securitycode, -4) : '';
$ec_securitycodemask = $ec_securitycode ? $ec_securitycode[0].'********'.substr($ec_securitycode, -4) : '';
if(!submitcheck('alipaysubmit')) {
@@ -126,7 +126,7 @@ EOT;
$settingsnew['ec_account'] = trim($settingsnew['ec_account']);
$settingsnew['ec_securitycode'] = trim($settingsnew['ec_securitycode']);
C::t('common_setting')->update('ec_account', $settingsnew['ec_account']);
$ec_securitycodemasknew = $settingsnew['ec_securitycode'] ? $settingsnew['ec_securitycode']{0}.'********'.substr($settingsnew['ec_securitycode'], -4) : '';
$ec_securitycodemasknew = $settingsnew['ec_securitycode'] ? $settingsnew['ec_securitycode'][0].'********'.substr($settingsnew['ec_securitycode'], -4) : '';
$settingsnew['ec_securitycode'] = $ec_securitycodemasknew == $ec_securitycodemask ? $ec_securitycode : $settingsnew['ec_securitycode'];
$ec_contract = addslashes(authcode($settingsnew['ec_contract']."\t".$settingsnew['ec_securitycode']."\t".$settingsnew['ec_partner']."\t".$settingsnew['ec_creditdirectpay'], 'ENCODE', $_G['config']['security']['authkey']));
C::t('common_setting')->update('ec_contract', $ec_contract);
@@ -202,13 +202,13 @@ EOT;
showtitle('ec_tenpay_opentrans');
showsetting('ec_tenpay_opentrans_chnid', 'settingsnew[ec_tenpay_opentrans_chnid]', $settings['ec_tenpay_opentrans_chnid'], 'text');
$tenpay_securitycodemask = $settings['ec_tenpay_opentrans_key'] ? $settings['ec_tenpay_opentrans_key']{0}.'********'.substr($settings['ec_tenpay_opentrans_key'], -4) : '';
$tenpay_securitycodemask = $settings['ec_tenpay_opentrans_key'] ? $settings['ec_tenpay_opentrans_key'][0].'********'.substr($settings['ec_tenpay_opentrans_key'], -4) : '';
showsetting('ec_tenpay_opentrans_key', 'settingsnew[ec_tenpay_opentrans_key]', $tenpay_securitycodemask, 'text');
showtitle('ec_tenpay');
showsetting('ec_tenpay_bargainor', 'settingsnew[ec_tenpay_bargainor]', $settings['ec_tenpay_bargainor'], 'text');
$tenpay_securitycodemask = $settings['ec_tenpay_key'] ? $settings['ec_tenpay_key']{0}.'********'.substr($settings['ec_tenpay_key'], -4) : '';
$tenpay_securitycodemask = $settings['ec_tenpay_key'] ? $settings['ec_tenpay_key'][0].'********'.substr($settings['ec_tenpay_key'], -4) : '';
showsetting('ec_tenpay_key', 'settingsnew[ec_tenpay_key]', $tenpay_securitycodemask, 'text');
showsetting('ec_tenpay_check', '', '',
'<a href="'.ADMINSCRIPT.'?action=ec&operation=tenpay&checktype=credit" target="_blank">'.$lang['ec_alipay_checklink_credit'].'</a><br />'.
@@ -227,11 +227,11 @@ EOT;
$settingsnew = $_GET['settingsnew'];
$settingsnew['ec_tenpay_bargainor'] = trim($settingsnew['ec_tenpay_bargainor']);
$settingsnew['ec_tenpay_key'] = trim($settingsnew['ec_tenpay_key']);
$tenpay_securitycodemask = $settings['ec_tenpay_key'] ? $settings['ec_tenpay_key']{0}.'********'.substr($settings['ec_tenpay_key'], -4) : '';
$tenpay_securitycodemask = $settings['ec_tenpay_key'] ? $settings['ec_tenpay_key'][0].'********'.substr($settings['ec_tenpay_key'], -4) : '';
$settingsnew['ec_tenpay_key'] = $tenpay_securitycodemask == $settingsnew['ec_tenpay_key'] ? $settings['ec_tenpay_key'] : $settingsnew['ec_tenpay_key'];
$settingsnew['ec_tenpay_opentrans_key'] = trim($settingsnew['ec_tenpay_opentrans_key']);
$tenpay_securitycodemask = $settings['ec_tenpay_opentrans_key'] ? $settings['ec_tenpay_opentrans_key']{0}.'********'.substr($settings['ec_tenpay_opentrans_key'], -4) : '';
$tenpay_securitycodemask = $settings['ec_tenpay_opentrans_key'] ? $settings['ec_tenpay_opentrans_key'][0].'********'.substr($settings['ec_tenpay_opentrans_key'], -4) : '';
$settingsnew['ec_tenpay_opentrans_key'] = $tenpay_securitycodemask == $settingsnew['ec_tenpay_opentrans_key'] ? $settings['ec_tenpay_opentrans_key'] : $settingsnew['ec_tenpay_opentrans_key'];
if($settingsnew['ec_tenpay_direct'] && (!empty($settingsnew['ec_tenpay_bargainor']) && !preg_match('/^\d{10}$/', $settingsnew['ec_tenpay_bargainor']))) {
cpmsg('tenpay_bargainor_invalid', 'action=ec&operation=tenpay', 'error');
upload/source/admincp/admincp_search.php
@@ -43,7 +43,7 @@ if($_GET['searchsubmit'] && $keywords) {
foreach($result as $skey => $tkeys) {
$tmp = array();
foreach($searchindex[$skey]['index'] as $title => $url) {
if($title{0} != '_') {
if($title[0] != '_') {
$tmp[] = '<a href="'.ADMINSCRIPT.'?'.$url.'&highlight='.rawurlencode($keywords).'" target="_blank">'.$title.'</a>';
}
}
upload/source/admincp/admincp_setting.php
@@ -521,9 +521,9 @@ if(!submitcheck('settingsubmit')) {
} elseif($operation == 'styles') {
$_G['setting']['showsettings'] = str_pad(decbin($setting['showsettings']), 3, 0, STR_PAD_LEFT);
$setting['showsignatures'] = $_G['setting']['showsettings']{0};
$setting['showavatars'] = $_G['setting']['showsettings']{1};
$setting['showimages'] = $_G['setting']['showsettings']{2};
$setting['showsignatures'] = $_G['setting']['showsettings'][0];
$setting['showavatars'] = $_G['setting']['showsettings'][1];
$setting['showimages'] = $_G['setting']['showsettings'][2];
$setting['postnocustom'] = implode("\n", (array)dunserialize($setting['postnocustom']));
$setting['sitemessage'] = dunserialize($setting['sitemessage']);
$setting['disallowfloat'] = $setting['disallowfloat'] ? dunserialize($setting['disallowfloat']) : array();
@@ -1151,9 +1151,9 @@ EOF;
} elseif($operation == 'editor') {
$_G['setting']['editoroptions'] = str_pad(decbin($setting['editoroptions']), 3, 0, STR_PAD_LEFT);
$setting['defaulteditormode'] = $_G['setting']['editoroptions']{0};
$setting['allowswitcheditor'] = $_G['setting']['editoroptions']{1};
$setting['simplemode'] = $_G['setting']['editoroptions']{2};
$setting['defaulteditormode'] = $_G['setting']['editoroptions'][0];
$setting['allowswitcheditor'] = $_G['setting']['editoroptions'][1];
$setting['simplemode'] = $_G['setting']['editoroptions'][2];
/*search={"setting_editor":"action=setting&operation=editor","setting_editor_global":"action=setting&operation=editor"}*/
showtableheader();
@@ -1553,7 +1553,7 @@ EOF;
} elseif($operation == 'mail' && $isfounder) {
$setting['mail'] = dunserialize($setting['mail']);
$passwordmask = $setting['mail']['auth_password'] ? $setting['mail']['auth_password']{0}.'********'.substr($setting['mail']['auth_password'], -2) : '';
$passwordmask = $setting['mail']['auth_password'] ? $setting['mail']['auth_password'][0].'********'.substr($setting['mail']['auth_password'], -2) : '';
/*search={"setting_mail":"action=setting&operation=mail","setting_mail_setting":"action=setting&operation=mail&anchor=setting"}*/
showtableheader('', '', 'id="mailsetting"'.($_GET['anchor'] != 'setting' ? ' style="display: none"' : ''));
@@ -1606,7 +1606,7 @@ EOF;
EOF;
foreach($setting['mail']['smtp'] as $id => $smtp) {
$checkauth = $smtp['auth'] ? 'checked' : '';
$smtp['auth_password'] = $smtp['auth_password'] ? $smtp['auth_password']{0}.'********'.substr($smtp['auth_password'], -2) : '';
$smtp['auth_password'] = $smtp['auth_password'] ? $smtp['auth_password'][0].'********'.substr($smtp['auth_password'], -2) : '';
showtablerow('', array('class="td25"', 'class="td28"', 'class="td28"'), array(
"<input class=\"checkbox\" type=\"checkbox\" name=\"settingnew[mail][smtp][delete][]\" value=\"$id\">",
"<input type=\"text\" class=\"txt\" name=\"settingnew[mail][smtp][$id][server]\" value=\"$smtp[server]\" style=\"width: 90%;\">",
@@ -1635,7 +1635,7 @@ EOF;
EOF;
foreach($setting['mail']['smtp'] as $id => $smtp) {
$checkauth = $smtp['auth'] ? 'checked' : '';
$smtp['auth_password'] = $smtp['auth_password'] ? $smtp['auth_password']{0}.'********'.substr($smtp['auth_password'], -2) : '';
$smtp['auth_password'] = $smtp['auth_password'] ? $smtp['auth_password'][0].'********'.substr($smtp['auth_password'], -2) : '';
showtablerow('', array('class="td25"', 'class="td28"', 'class="td28"', 'class="td25"'), array(
"<input class=\"checkbox\" type=\"checkbox\" name=\"settingnew[mail][esmtp][delete][]\" value=\"$id\">",
@@ -1977,7 +1977,7 @@ EOT;
$setting['ftp'] = dunserialize($setting['ftp']);
$setting['ftp'] = is_array($setting['ftp']) ? $setting['ftp'] : array();
$setting['ftp']['password'] = authcode($setting['ftp']['password'], 'DECODE', md5($_G['config']['security']['authkey']));
$setting['ftp']['password'] = $setting['ftp']['password'] ? $setting['ftp']['password']{0}.'********'.$setting['ftp']['password']{strlen($setting['ftp']['password']) - 1} : '';
$setting['ftp']['password'] = $setting['ftp']['password'] ? $setting['ftp']['password'][0].'********'.$setting['ftp']['password'][strlen($setting['ftp']['password']) - 1] : '';
require_once libfile('function/cache');
@@ -3143,7 +3143,7 @@ EOT;
if($pwlen < 3) {
cpmsg('ftp_password_short', '', 'error');
}
if($settingnew['ftp']['password']{0} == $setting['ftp']['password']{0} && $settingnew['ftp']['password']{$pwlen - 1} == $setting['ftp']['password']{strlen($setting['ftp']['password']) - 1} && substr($settingnew['ftp']['password'], 1, $pwlen - 2) == '********') {
if($settingnew['ftp']['password'][0] == $setting['ftp']['password'][0] && $settingnew['ftp']['password'][$pwlen - 1] == $setting['ftp']['password'][strlen($setting['ftp']['password']) - 1] && substr($settingnew['ftp']['password'], 1, $pwlen - 2) == '********') {
$settingnew['ftp']['password'] = $setting['ftp']['password'];
}
$settingnew['ftp']['password'] = authcode($settingnew['ftp']['password'], 'ENCODE', md5($_G['config']['security']['authkey']));
@@ -3157,7 +3157,7 @@ EOT;
$deletesmtp = $settingnew['mail']['mailsend'] != 1 ? ($settingnew['mail']['mailsend'] == 3 ? $settingnew['mail']['smtp']['delete'] : $settingnew['mail']['esmtp']['delete']) : array();
foreach($oldsmtp as $id => $value) {
if((empty($deletesmtp) || !in_array($id, $deletesmtp)) && !empty($value['server']) && !empty($value['port'])) {
$passwordmask = $setting['mail']['smtp'][$id]['auth_password'] ? $setting['mail']['smtp'][$id]['auth_password']{0}.'********'.substr($setting['mail']['smtp'][$id]['auth_password'], -2) : '';
$passwordmask = $setting['mail']['smtp'][$id]['auth_password'] ? $setting['mail']['smtp'][$id]['auth_password'][0].'********'.substr($setting['mail']['smtp'][$id]['auth_password'], -2) : '';
$value['auth_password'] = $value['auth_password'] == $passwordmask ? $setting['mail']['smtp'][$id]['auth_password'] : $value['auth_password'];
$settingnew['mail']['smtp'][] = $value;
}
upload/source/class/cache/cache_file.php
@@ -74,7 +74,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];
upload/source/class/class_gifmerge.php
@@ -293,7 +293,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;
}
}
upload/source/class/class_member.php
@@ -62,7 +62,7 @@ class logging_ctl {
$cookietimecheck = !empty($_G['cookie']['cookietime']) || !empty($_GET['cookietime']) ? 'checked="checked"' : '';
if($seccodecheck) {
$seccode = random(6, 1) + $seccode{0} * 1000000;
$seccode = random(6, 1) + $seccode[0] * 1000000;
}
if($this->extrafile && file_exists($this->extrafile)) {
upload/source/class/helper/helper_seccheck.php
@@ -95,7 +95,7 @@ class helper_seccheck {
if($seccodeunits) {
$seccode = '';
for($i = 0; $i < 4; $i++) {
$unit = ord($s{$i});
$unit = ord($s[$i]);
$seccode .= ($unit >= 0x30 && $unit <= 0x39) ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57];
}
}
upload/source/class/table/table_forum_attachment_n.php
@@ -29,7 +29,7 @@ class table_forum_attachment_n extends discuz_table
$tableid = DB::result_first("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE aid='$aid'");
} elseif($idtype == 'tid') {
$tid = (string)$id;
$tableid = dintval($tid{strlen($tid)-1});
$tableid = dintval($tid[strlen($tid)-1]);
} elseif($idtype == 'pid') {
$pid = dintval($id);
$tableid = DB::result_first("SELECT tableid FROM ".DB::table('forum_attachment')." WHERE pid='$pid' LIMIT 1");
upload/source/function/cache/cache_styles.php
@@ -79,7 +79,7 @@ function setcssbackground(&$data, $code) {
for($i = 0; $i < count($codes); $i++) {
if($i < 2) {
if($codes[$i] != '') {
if($codes[$i]{0} == '#') {
if($codes[$i][0] == '#') {
$css .= strtoupper($codes[$i]).' ';
$codevalue = strtoupper($codes[$i]);
} elseif(preg_match('/^(https?:)?\/\//i', $codes[$i])) {
upload/source/function/function_editor.php
@@ -13,7 +13,7 @@ if(!defined('IN_DISCUZ')) {
function absoluteurl($url) {
global $_G;
if($url{0} == '/') {
if($url[0] == '/') {
return 'http://'.$_SERVER['HTTP_HOST'].$url;
} else {
return $_G['siteurl'].$url;
@@ -63,9 +63,9 @@ function divtag($divoptions, $text) {
function fetchoptionvalue($option, $text) {
if(($position = strpos($text, $option)) !== false) {
$delimiter = $position + strlen($option);
if($text{$delimiter} == '"') {
if($text[$delimiter] == '"') {
$delimchar = '"';
} elseif($text{$delimiter} == '\'') {
} elseif($text[$delimiter] == '\'') {
$delimchar = '\'';
} else {
$delimchar = ' ';
@@ -309,7 +309,7 @@ function recursion($tagname, $text, $function, $extraargs = '') {
$found = FALSE;
$tagnameend = FALSE;
for($optionend = $tagbegin; $optionend <= $strlen; $optionend++) {
$char = $text{$optionend};
$char = $text[$optionend];
if(($char == '"' || $char == "'") && $inquote == '') {
$inquote = $char;
} elseif(($char == '"' || $char == "'") && $inquote == $char) {
upload/source/module/forum/forum_post.php
@@ -276,8 +276,8 @@ if(!$sortid && !$specialextra) {
$editorid = 'e';
$_G['setting']['editoroptions'] = str_pad(decbin($_G['setting']['editoroptions']), 3, 0, STR_PAD_LEFT);
$editormode = $_G['setting']['editoroptions']{0};
$allowswitcheditor = $_G['setting']['editoroptions']{1};
$editormode = $_G['setting']['editoroptions'][0];
$allowswitcheditor = $_G['setting']['editoroptions'][1];
$editor = array(
'editormode' => $editormode,
'allowswitcheditor' => $allowswitcheditor,
@@ -289,7 +289,7 @@ $editor = array(
'allowchecklength' => 1,
'allowtopicreset' => 1,
'textarea' => 'message',
'simplemode' => !isset($_G['cookie']['editormode_'.$editorid]) ? !$_G['setting']['editoroptions']{2} : $_G['cookie']['editormode_'.$editorid],
'simplemode' => !isset($_G['cookie']['editormode_'.$editorid]) ? !$_G['setting']['editoroptions'][2] : $_G['cookie']['editormode_'.$editorid],
);
if($specialextra) {
$special = 127;
upload/source/module/forum/forum_viewthread.php
@@ -307,9 +307,9 @@ $lastmod = viewthread_lastmod($_G['forum_thread']);
$showsettings = str_pad(decbin($_G['setting']['showsettings']), 3, '0', STR_PAD_LEFT);
$showsignatures = $showsettings{0};
$showavatars = $showsettings{1};
$_G['setting']['showimages'] = $showsettings{2};
$showsignatures = $showsettings[0];
$showavatars = $showsettings[1];
$_G['setting']['showimages'] = $showsettings[2];
$highlightstatus = isset($_GET['highlight']) && str_replace('+', '', $_GET['highlight']) ? 1 : 0;
upload/source/plugin/mobile/api/1/newthread.php
@@ -51,7 +51,7 @@ class mobile_api {
$mobiletype = base_convert($_POST['mobiletype'], 10, 2);
$mobiletype = sprintf('%03d', $mobiletype);
for($i = 0;$i < 3;$i++) {
$poststatus = setstatus(10 - $i, $mobiletype{$i}, $poststatus);
$poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
}
}
C::t('forum_post')->update(0, $values['pid'], array('status' => $poststatus));
upload/source/plugin/mobile/api/1/sendreply.php
@@ -59,7 +59,7 @@ class mobile_api {
$mobiletype = base_convert($_POST['mobiletype'], 10, 2);
$mobiletype = sprintf('%03d', $mobiletype);
for($i = 0;$i < 3;$i++) {
$poststatus = setstatus(10 - $i, $mobiletype{$i}, $poststatus);
$poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
}
}
C::t('forum_post')->update('tid:'.$values['tid'], $values['pid'], array('status' => $poststatus));
upload/source/plugin/mobile/api/3/sendreply.php
@@ -59,7 +59,7 @@ class mobile_api {
$mobiletype = base_convert($_POST['mobiletype'], 10, 2);
$mobiletype = sprintf('%03d', $mobiletype);
for($i = 0;$i < 3;$i++) {
$poststatus = setstatus(10 - $i, $mobiletype{$i}, $poststatus);
$poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
}
}
C::t('forum_post')->update('tid:'.$values['tid'], $values['pid'], array('status' => $poststatus));
upload/source/plugin/mobile/api/4/newthread.php
@@ -51,7 +51,7 @@ class mobile_api {
$mobiletype = base_convert($_POST['mobiletype'], 10, 2);
$mobiletype = sprintf('%03d', $mobiletype);
for($i = 0;$i < 3;$i++) {
$poststatus = setstatus(10 - $i, $mobiletype{$i}, $poststatus);
$poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
}
}
C::t('forum_post')->update(0, $values['pid'], array('status' => $poststatus));
upload/source/plugin/mobile/api/4/sendreply.php
@@ -62,7 +62,7 @@ class mobile_api {
$mobiletype = base_convert($_POST['mobiletype'], 10, 2);
$mobiletype = sprintf('%03d', $mobiletype);
for ($i = 0; $i < 3; $i++) {
$poststatus = setstatus(10 - $i, $mobiletype{$i}, $poststatus);
$poststatus = setstatus(10 - $i, $mobiletype[$i], $poststatus);
}
}
C::t('forum_post')->update('tid:' . $values['tid'], $values['pid'], array('status' => $poststatus));
upload/source/plugin/mobile/json.class.php
@@ -32,7 +32,7 @@ class CJSON {
$ascii = '';
$strlen_var = strlen($var);
for ($c = 0; $c < $strlen_var; ++$c) {
$ord_var_c = ord($var{$c});
$ord_var_c = ord($var[$c]);
switch (true) {
case $ord_var_c == 0x08:
$ascii .= '\b';
@@ -53,15 +53,15 @@ class CJSON {
case $ord_var_c == 0x22:
case $ord_var_c == 0x2F:
case $ord_var_c == 0x5C:
$ascii .= '\\'.$var{$c};
$ascii .= '\\'.$var[$c];
break;
case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
$ascii .= $var{$c};
$ascii .= $var[$c];
break;
case (($ord_var_c & 0xE0) == 0xC0):
$char = pack('C*', $ord_var_c, ord($var{$c+1}));
$char = pack('C*', $ord_var_c, ord($var[$c+1]));
$c+=1;
$utf16 = self::utf8ToUTF16BE($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -69,8 +69,8 @@ class CJSON {
case (($ord_var_c & 0xF0) == 0xE0):
$char = pack('C*', $ord_var_c,
ord($var{$c+1}),
ord($var{$c+2}));
ord($var[$c+1]),
ord($var[$c+2]));
$c+=2;
$utf16 = self::utf8ToUTF16BE($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -78,9 +78,9 @@ class CJSON {
case (($ord_var_c & 0xF8) == 0xF0):
$char = pack('C*', $ord_var_c,
ord($var{$c+1}),
ord($var{$c+2}),
ord($var{$c+3}));
ord($var[$c+1]),
ord($var[$c+2]),
ord($var[$c+3]));
$c+=3;
$utf16 = self::utf8ToUTF16BE($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -88,10 +88,10 @@ class CJSON {
case (($ord_var_c & 0xFC) == 0xF8):
$char = pack('C*', $ord_var_c,
ord($var{$c+1}),
ord($var{$c+2}),
ord($var{$c+3}),
ord($var{$c+4}));
ord($var[$c+1]),
ord($var[$c+2]),
ord($var[$c+3]),
ord($var[$c+4]));
$c+=4;
$utf16 = self::utf8ToUTF16BE($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -99,11 +99,11 @@ class CJSON {
case (($ord_var_c & 0xFE) == 0xFC):
$char = pack('C*', $ord_var_c,
ord($var{$c+1}),
ord($var{$c+2}),
ord($var{$c+3}),
ord($var{$c+4}),
ord($var{$c+5}));
ord($var[$c+1]),
ord($var[$c+2]),
ord($var[$c+3]),
ord($var[$c+4]),
ord($var[$c+5]));
$c+=5;
$utf16 = self::utf8ToUTF16BE($char);
$ascii .= sprintf('\u%04s', bin2hex($utf16));
@@ -194,7 +194,7 @@ class CJSON {
for ($c = 0; $c < $strlen_chrs; ++$c) {
$substr_chrs_c_2 = substr($chrs, $c, 2);
$ord_chrs_c = ord($chrs{$c});
$ord_chrs_c = ord($chrs[$c]);
switch (true) {
case $substr_chrs_c_2 == '\b':
@@ -224,7 +224,7 @@ class CJSON {
case $substr_chrs_c_2 == '\\/':
if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
($delim == "'" && $substr_chrs_c_2 != '\\"')) {
$utf8 .= $chrs{++$c};
$utf8 .= $chrs[++$c];
}
break;
@@ -236,7 +236,7 @@ class CJSON {
break;
case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
$utf8 .= $chrs{$c};
$utf8 .= $chrs[$c];
break;
case ($ord_chrs_c & 0xE0) == 0xC0:
@@ -272,7 +272,7 @@ class CJSON {
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
if ($str{0} == '[') {
if ($str[0] == '[') {
$stk = array(self::JSON_IN_ARR);
$arr = array();
} else {
@@ -309,7 +309,7 @@ class CJSON {
$top = end($stk);
$substr_chrs_c_2 = substr($chrs, $c, 2);
if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == self::JSON_SLICE))) {
if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == self::JSON_SLICE))) {
$slice = substr($chrs, $top['where'], ($c - $top['where']));
array_push($stk, array('what' => self::JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
@@ -339,22 +339,22 @@ class CJSON {
}
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != self::JSON_IN_STR)) {
array_push($stk, array('what' => self::JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
} elseif (($chrs{$c} == $top['delim']) &&
} elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != self::JSON_IN_STR)) {
array_push($stk, array('what' => self::JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
} elseif (($chrs[$c] == $top['delim']) &&
($top['what'] == self::JSON_IN_STR) &&
(($chrs{$c - 1} != "\\") ||
($chrs{$c - 1} == "\\" && $chrs{$c - 2} == "\\"))) {
(($chrs[$c - 1] != "\\") ||
($chrs[$c - 1] == "\\" && $chrs[$c - 2] == "\\"))) {
array_pop($stk);
} elseif (($chrs{$c} == '[') &&
} elseif (($chrs[$c] == '[') &&
in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) {
array_push($stk, array('what' => self::JSON_IN_ARR, 'where' => $c, 'delim' => false));
} elseif (($chrs{$c} == ']') && ($top['what'] == self::JSON_IN_ARR)) {
} elseif (($chrs[$c] == ']') && ($top['what'] == self::JSON_IN_ARR)) {
array_pop($stk);
} elseif (($chrs{$c} == '{') &&
} elseif (($chrs[$c] == '{') &&
in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) {
array_push($stk, array('what' => self::JSON_IN_OBJ, 'where' => $c, 'delim' => false));
} elseif (($chrs{$c} == '}') && ($top['what'] == self::JSON_IN_OBJ)) {
} elseif (($chrs[$c] == '}') && ($top['what'] == self::JSON_IN_OBJ)) {
array_pop($stk);
} elseif (($substr_chrs_c_2 == '/**') &&
in_array($top['what'], array(self::JSON_SLICE, self::JSON_IN_ARR, self::JSON_IN_OBJ))) {
upload/uc_server/control/admin/plugin.php
@@ -43,7 +43,7 @@ class pluginbase extends adminbase {
function _call($a, $arg) {
$do = getgpc('do');
$do = empty($do) ? 'onindex' : 'on'.$do;
if(method_exists($this, $do) && $do{0} != '_') {
if(method_exists($this, $do) && $do[0] != '_') {
$this->$do();
} else {
exit('Plugin module not found');
upload/uc_server/index.php
@@ -63,7 +63,7 @@ if(in_array($m, array('app', 'frame', 'user', 'pm', 'pm_client', 'tag', 'feed',
$classname = $m.'control';
$control = new $classname();
$method = 'on'.$a;
if(method_exists($control, $method) && $a{0} != '_') {
if(method_exists($control, $method) && $a[0] != '_') {
$data = $control->$method();
echo is_array($data) ? $control->serialize($data, 1) : $data;
exit;
upload/uc_server/lib/seccode.class.php
@@ -41,7 +41,7 @@ class seccode {
$seccodeunits = 'CEFHKLMNOPQRSTUVWXYZ';
$seccode = '';
for($i = 0; $i < 4; $i++) {
$unit = ord($s{$i});
$unit = ord($s[$i]);
$seccode .= ($unit >= 0x30 && $unit <= 0x39) ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57];
}
}
upload/uc_server/model/admin.php
@@ -94,7 +94,7 @@ class adminbase extends base {
}
function _call($a, $arg) {
if(method_exists($this, $a) && $a{0} != '_') {
if(method_exists($this, $a) && $a[0] != '_') {
$this->$a();
} else {
exit('Method does not exists');
utility/update.php
@@ -760,11 +760,11 @@ if($_GET['step'] == 'start') {
$seccodedata = dunserialize($settings['seccodedata']);
if(!$seccodedata['rule']) {
$seccodestatuss = sprintf('%05b', $seccodecheck);
$seccodedata['rule']['register']['allow'] = $seccodestatuss{4};
$seccodedata['rule']['login']['allow'] = $seccodestatuss{3};
$seccodedata['rule']['post']['allow'] = $seccodestatuss{2};
$seccodedata['rule']['password']['allow'] = $seccodestatuss{1};
$seccodedata['rule']['card']['allow'] = $seccodestatuss{0};
$seccodedata['rule']['register']['allow'] = $seccodestatuss[4];
$seccodedata['rule']['login']['allow'] = $seccodestatuss[3];
$seccodedata['rule']['post']['allow'] = $seccodestatuss[2];
$seccodedata['rule']['password']['allow'] = $seccodestatuss[1];
$seccodedata['rule']['card']['allow'] = $seccodestatuss[0];
$seccodedata['seccodedata']['type'] = intval($seccodedata['seccodedata']['type']);
$newsettings['seccodedata'] = serialize($seccodedata);
}
@@ -1460,7 +1460,7 @@ if($_GET['step'] == 'start') {
if(DB::num_rows($query)) {
while($row = DB::fetch($query)) {
$tid = (string)$row['tid'];
$tableid = $tid{strlen($tid)-1};
$tableid = $tid[strlen($tid)-1];
DB::update('forum_attachment', array('tableid' => $tableid), array('aid' => $row['aid']));
DB::insert('forum_attachment_'.$tableid, array(
'aid' => $row['aid'],
PHP
1
https://gitee.com/ComsenzDiscuz/DiscuzX.git
git@gitee.com:ComsenzDiscuz/DiscuzX.git
ComsenzDiscuz
DiscuzX
DiscuzX

Help Search

182353 aa51c838 1899542 205747 347fc4a1 1899542