\include 目录
cache.func.php
找
- define('DISCUZ_KERNEL_RELEASE', '20070324');
复制代码
替换为成
- define('DISCUZ_KERNEL_RELEASE', '20070724');
复制代码
找
- function arrayeval($array, $level = 0) {
复制代码
下面添加
- if(is_array($array) && function_exists('var_export')) {
- return var_export($array, true);
- }
复制代码
找
- writetocache($script, $cachenames);
复制代码
替换为成
- $cachedata = '';
- if($cachename && !is_array($cachename) && $script <> $cachename) {
- $_DCACHE = array();
- @include(DISCUZ_ROOT.'./forumdata/cache/cache_'.$script.'.php');
- if($_DCACHE && isset($_DCACHE[$cachename])) {
- foreach ($_DCACHE as $key => $val) {
- $cachedata .= ($key == $cachename) ? getcachearray($cachename, $script) : getcachevars(array("_DCACHE['$key']" => $val));
- }
- }
- }
- writetocache($script, $cachenames, $cachedata);
复制代码
找
- $query = $db->query("SELECT * FROM {$tablepre}stylevars");
复制代码
替换为成
- $defaultstyleid = $_DCACHE['settings']['styleid'] ? $_DCACHE['settings']['styleid'] : $GLOBALS['styleid'];
- $query = $db->query("SELECT sv.* FROM {$tablepre}stylevars sv LEFT JOIN {$tablepre}styles s ON s.styleid = sv.styleid AND (s.available=1 OR s.styleid='$defaultstyleid')");
复制代码
找
- $query = $db->query("SELECT s.*, t.directory AS tpldir FROM {$tablepre}styles s LEFT JOIN {$tablepre}templates t ON s.templateid=t.templateid");
复制代码
替换为成
- $query = $db->query("SELECT s.*, t.directory AS tpldir FROM {$tablepre}styles s LEFT JOIN {$tablepre}templates t ON s.templateid=t.templateid WHERE s.available=1 OR s.styleid='$defaultstyleid'");
复制代码
找
- } elseif($setting['variable'] == 'attachdir') {
复制代码
下面添加
- $setting['value'] = preg_replace("/\.asp|\\0/i", '0', $setting['value']);
复制代码
找
- if(!isset($data['supe']['attachurl']) && isset($supe['tablepre'])) {
复制代码
替换为
- if((!isset($data['supe']['attachurl']) || !isset($data['supe']['tpldir'])) && isset($supe['tablepre'])) {
复制代码
找
- $query = $supe['db']->query("SELECT * FROM {$supe[tablepre]}settings WHERE variable IN ('attachmentdir', 'attachmenturl')");
复制代码
替换为
- $query = $supe['db']->query("SELECT * FROM {$supe[tablepre]}settings WHERE variable IN ('attachmentdir', 'attachmenturl', 'template')");
复制代码
找
- $data['supe']['attachurl'] = $supe_settings['attachmenturl'];
复制代码
下面添加
- $data['supe']['tpldir'] = $supe_settings['template'];
复制代码
找
- if(!$data['supe']['dbmode']) {
- unset($data['supe']['dbhost'], $data['supe']['dbuser'], $data['supe']['dbpw'], $data['supe']['dbname']);
- }
复制代码
下面添加
- if($data['supe']['siteurl']{strlen($data['supe']['siteurl'])-1} != '/') {
- $data['supe']['siteurl'] .= '/';
- }
复制代码
找
- $data['redirectadvs'] = $globaladvs['redirect'] ? $globaladvs['redirect'] : array();
复制代码
下面添加
- if($data['qihoo_relatedthreads'] = unserialize($data['qihoo_relatedthreads'])) {
- $data['qihoo_relate_bbsnum'] = intval($data['qihoo_relatedthreads']['bbsnum']);
- if($data['qihoo_relatedthreads']['webnum']) {
- $data['qihoo_relate_webnum'] = intval($data['qihoo_relatedthreads']['webnum']);
- $data['qihoo_relate_banurl'] = $data['qihoo_relatedthreads']['banurl'] ? '/('.str_replace("\r\n", '|', $data['qihoo_relatedthreads']['banurl']).')/i' : '';
- if(is_array($data['qihoo_relatedthreads']['type'])) {
- $data['qihoo_relate_type'] = implode('|', $data['qihoo_relatedthreads']['type']);
- }
- }
- $data['qihoo_relate_position'] = intval($data['qihoo_relatedthreads']['position']);
- $data['qihoo_relate_order'] = intval($data['qihoo_relatedthreads']['order']);
- $data['qihoo_relate_validity'] = intval($data['qihoo_relatedthreads']['validity']);
- }
- unset($data['qihoo_relatedthreads']);
复制代码
找
- $replace = '\''.str_replace('{RANDOM}', '_\'.random(6).\'', str_replace('{MD5}', '_\'.md5("\\1").\'', $bbcode['replacement'])).'\'';
复制代码
替换为
- $replace = '\''.str_replace('{RANDOM}', '_\'.random(6).\'', str_replace('{MD5}', '_\'.md5(\'\\1\').\'', $bbcode['replacement'])).'\'';
复制代码
common.inc.php
找
- define('SYS_DEBUG', FALSE);
复制代码
删除掉!
找
- require_once DISCUZ_ROOT.'./include/global.func.php';
复制代码
上面添加
- if (isset($_REQUEST['GLOBALS']) OR isset($_FILES['GLOBALS'])) {
- exit('Request tainting attempted.');
- }
复制代码
找
- isset($_REQUEST['GLOBALS']) && exit('Access Error');
复制代码
删除掉!
找
- $charset = $dbcharset = $forumfounders = $metakeywords = $extrahead = '';
- $plugins = $hooks = $admincp = array();
复制代码
替换为
- $charset = $dbcharset = $forumfounders = $metakeywords = $extrahead = $seodescription = '';
- $plugins = $hooks = $admincp = $jsmenu = $forum = $thread = $language = $actioncode = $modactioncode = $lang = array();
复制代码
找
- unset($prelength, $_request, $_key, $_value);
复制代码
替换为
- unset($prelength, $_request, $_key, $_value, $_request, $protected);
- $inajax = !empty($inajax);
复制代码
找
- $boardurl = 'http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api|archiver|wap)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/';
复制代码
替换为
- $boardurl = htmlspecialchars('http://'.$_SERVER['HTTP_HOST'].preg_replace("/\/+(api|archiver|wap)?\/*$/i", '', substr($PHP_SELF, 0, strrpos($PHP_SELF, '/'))).'/');
复制代码
找
- $dbhost = $dbuser = $dbpw = $dbname = $pconnect = NULL;
复制代码
替换为
- $dbuser = $dbpw = $dbname = $pconnect = NULL;
复制代码
找
- $statstatus && require_once DISCUZ_ROOT.'./include/counter.inc.php';
复制代码
替换为
- $statstatus && !$inajax && require_once DISCUZ_ROOT.'./include/counter.inc.php';
复制代码
找
- $extra = isset($extra) && @preg_match("/^[&=;a-z0-9]+$/i", $extra) ? $extra : '';
复制代码
下面添加
- $tpp = intval(empty($_DSESSION['tpp']) ? $topicperpage : $_DSESSION['tpp']);
- $ppp = intval(empty($_DSESSION['ppp']) ? $postperpage : $_DSESSION['ppp']);
复制代码
找
- if(!in_array($adminid, array(1, 2, 3))) {
复制代码
上面添加
- $tpp = intval(empty($_DSESSION['tpp']) ? $topicperpage : $_DSESSION['tpp']);
- $ppp = intval(empty($_DSESSION['ppp']) ? $postperpage : $_DSESSION['ppp']);
复制代码
cron.func.php
找
- $query = $db->query("SELECT * FROM {$tablepre}crons WHERE ".($cronid ? "cronid='$cronid'" : "available>'0' AND nextrun<='$timestamp'")." LIMIT 1");
复制代码
替换为
- $query = $db->query("SELECT * FROM {$tablepre}crons WHERE ".($cronid ? "cronid='$cronid'" : "available>'0' AND nextrun<='$timestamp'")." ORDER BY nextrun LIMIT 1");
复制代码
找
- $lockfile = DISCUZ_ROOT.'./forumdata/runcron_'.$cron['cronid'].'.lock';
复制代码
下面添加
- $cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
- $cronfile = DISCUZ_ROOT.'./include/crons/'.$cron['filename'];
复制代码
找
- @set_time_limit(1000);
- @ignore_user_abort(TRUE);
复制代码
下面添加
- $cron['filename'] = str_replace(array('..', '/', '\\'), array('', '', ''), $cron['filename']);
复制代码
找
- if(!include_once DISCUZ_ROOT.($cronfile = "./include/crons/$cron[filename]")) {
- errorlog('CRON', $cron['name']." : Cron script($cronfile) not found or syntax error", 0);
复制代码
替换为成
- if(!@include $cronfile) {
- errorlog('CRON', $cron['name'].' : Cron script('.$cron['filename'].') not found or syntax error', 0);
复制代码
找
- require_once DISCUZ_ROOT.'./include/cache.func.php';
- $query = $db->query("SELECT nextrun FROM {$tablepre}crons WHERE available>'0' ORDER BY nextrun LIMIT 1");
- $_DCACHE['settings']['cronnextrun'] = $db->result($query, 0);
- updatesettings();
- @unlink($lockfile);
- }
- }
复制代码
替换为成
- @unlink($lockfile);
- }
- require_once DISCUZ_ROOT.'./include/cache.func.php';
- $query = $db->query("SELECT nextrun FROM {$tablepre}crons WHERE available>'0' ORDER BY nextrun LIMIT 1");
- $_DCACHE['settings']['cronnextrun'] = $db->result($query, 0);
- updatesettings();
- }
复制代码
找
- if(empty($cron)) return false;
复制代码
替换为成
- if(empty($cron)) return FALSE;
复制代码
找
- $db->query("UPDATE {$tablepre}crons SET lastrun='$timestamp', nextrun='$nextrun' WHERE cronid='$cron[cronid]'");
复制代码
下面添加
discuzcode.func.php
找
- global $language, $attachrefcheck, $thumbstatus, $extcredits, $creditstrans, $ftp;
复制代码
替换为
- global $language, $attachrefcheck, $thumbstatus, $extcredits, $creditstrans, $ftp, $exthtml;
复制代码
找
- $replacement .= '<div style="display:none" id="attach_'.$attach['aid'].'" onmouseover="showMenu(this.id, 0, 1)"><img src="'.IMGDIR.'/attachimg.gif" border="0"></div><div title="menu" class="t_attach" id="attach_'.$attach['aid'].'_menu" style="display: none">'.
复制代码
替换为
- $replacement .= '<span style="display:none" id="attach_'.$attach['aid'].'" onmouseover="showMenu(this.id, 0, 1)"><img src="'.IMGDIR.'/attachimg.gif" border="0"></span>';
- $exthtml .= '<div title="menu" class="t_attach" id="attach_'.$attach['aid'].'_menu" style="display: none">'.
复制代码
找
- $replacement .= $attach['attachicon'].' <span style="white-space:nowrap" id="attach_'.$attach['aid'].'" onmouseover="showMenu(this.id)"><a href="attachment.php?aid='.$attach['aid'].'" target="_blank" class="bold">'.$attach['filename'].'</a> ('.$attach['attachsize'].')</span>'.
- '<div title="menu" class="t_attach" id="attach_'.$attach['aid'].'_menu" style="display: none">'.$attach['attachicon'].' <a href="attachment.php?aid='.$attach['aid'].'" target="_blank" class="bold">'.$attach['filename'].'</a> ('.$attach['attachsize'].')<br>'.
复制代码
替换为
- $replacement .= $attach['attachicon'].' <span style="white-space:nowrap" id="attach_'.$attach['aid'].'" onmouseover="showMenu(this.id)"><a href="attachment.php?aid='.$attach['aid'].'" target="_blank" class="bold">'.$attach['filename'].'</a> ('.$attach['attachsize'].')</span>';
- $exthtml .= '<div title="menu" class="t_attach" id="attach_'.$attach['aid'].'_menu" style="display: none">'.$attach['attachicon'].' <a href="attachment.php?aid='.$attach['aid'].'" target="_blank" class="bold">'.$attach['filename'].'</a> ('.$attach['attachsize'].')<br>'.
复制代码
找
- $replacement .= ($attach['price'] ? $language['price'].': '.$extcredits[$creditstrans]['title'].' '.$attach['price'].' '.$extcredits[$creditstrans]['unit'].' <a href="misc.php?action=viewattachpayments&aid='.$aid.'" target="_blank">['.$language['pay_view'].']</a>'.
复制代码
替换为
- $exthtml .= ($attach['price'] ? $language['price'].': '.$extcredits[$creditstrans]['title'].' '.$attach['price'].' '.$extcredits[$creditstrans]['unit'].' <a href="misc.php?action=viewattachpayments&aid='.$aid.'" target="_blank">['.$language['pay_view'].']</a>'.
复制代码
找
- function parsetable($width, $bgcolor, $message) {
复制代码
下面添加
- if(!in_array(substr($message, 0, 4), array('[tr]', '<tr>'))) {
- return $message;
- }
复制代码
找
- "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/|callto:\/\/|bctp:\/\/|ed2k:\/\/){1}([^\["']+?)\s*\[\/url\]/ie",
复制代码
替换为
- "/\[url\]\s*(www.|https?:\/\/|ftp:\/\/|gopher:\/\/|news:\/\/|telnet:\/\/|rtsp:\/\/|mms:\/\/|callto:\/\/|bctp:\/\/|ed2k:\/\/|thunder:\/\/|synacast:\/\/){1}([^\["']+?)\s*\[\/url\]/ie",
复制代码
找
- "/\[color=([^\[\<]+?)\]/i",
复制代码
替换为
- "/\[color=([#\w]+?)\]/i",
复制代码
找
- "/\[align=([^\[\<]+?)\]/i",
- "/\[float=([^\[\<]+?)\]/i"
复制代码
替换为
- "/\[align=(left|center|right)\]/i",
- "/\[float=(left|right)\]/i"
复制代码
找
替换为
找
- "bbcodeurl('\\1', '<img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(\'%s\');}" onmousewheel="return imgzoom(this);" alt="" />')",
复制代码
替换为
- "bbcodeurl('\\1', '<img src="%s" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor=\'hand\'; this.alt=\'Click here to open new window\\nCTRL+Mouse wheel to zoom in/out\';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" />')",
复制代码
找
- $randomstr .= chr(mt_rand(0, 59)).chr(mt_rand(63, 126));
复制代码
替换为
- $randomstr .= chr(mt_rand(32, 59)).chr(mt_rand(63, 126));
复制代码
editpost.inc.php
找
- if((!$forum['ismoderator'] || !$alloweditpost || (in_array($orig['adminid'], array(1, 2, 3)) && $adminid > $orig['adminid'])) && !($forum['alloweditpost'] && $isorigauthor)) {
复制代码
替换为
- if(empty($orig)) {
- showmessage('undefined_action');
- } elseif((!$forum['ismoderator'] || !$alloweditpost || (in_array($orig['adminid'], array(1, 2, 3)) && $adminid > $orig['adminid'])) && !($forum['alloweditpost'] && $isorigauthor)) {
复制代码
找
- } elseif($thread['special'] == 4 && ($allowpostactivity || $thread['authorid'] == $discuz_uid)) {
复制代码
替换为
- } elseif($thread['special'] == 4) {
复制代码
找
- list($attach['width']) = @getimagesize($attach['url'].'/'.$attach['attachment']);
- $attach['width'] = !$attach['width'] || $attach['width'] > $thumbwidth ? $thumbwidth : $attach['width'];
复制代码
替换为
- list($attach['width'], $attach['height']) = @getimagesize($attach['url'].'/'.$attach['attachment']);
- $x_ratio = $attach['width'] ? $thumbwidth / $attach['width'] : 0;
- $y_ratio = $attach['height'] ? $thumbheight / $attach['height'] : 0;
- if(($x_ratio * $attach['height']) < $thumbheight) {
- $attach['width'] = $thumbwidth;
- } else {
- $attach['width'] = ceil($y_ratio * $attach['width']);
- }
复制代码
找
- $readperm = $allowsetreadperm ? $readperm : ($isorigauthor ? 0 : 'readperm');
复制代码
替换为
- $readperm = $allowsetreadperm ? intval($readperm) : ($isorigauthor ? 0 : 'readperm');
复制代码
找
- if(($alloweditpoll || $thread['authorid'] == $discuz_uid) && $thread['special'] == 1 && !empty($polls)) {
复制代码
替换为
- if($thread['special'] == 1 && ($alloweditpoll || $isorigauthor) && !empty($polls)) {
复制代码
找
- $pollarray['maxchoices'] = $maxchoices;
- }
- }
复制代码
下面添加
- $expiration = intval($expiration);
复制代码
找
- if(!$forum['ismoderator'] && $thread['authorid'] == $discuz_uid) {
复制代码
替换为
- if(!$forum['ismoderator']) {
复制代码
找
- $subject = $thread['subject'];
复制代码
替换为
- $subject = addslashes($thread['subject']);
复制代码
找
- } elseif($thread['special'] == 4 && ($allowpostactivity || $thread['authorid'] == $discuz_uid)) {
复制代码
替换为
- } elseif($thread['special'] == 4 && $allowpostactivity) {
复制代码
找
- } elseif(strtotime($starttimefrom[$activitytime]) === -1 || strtotime($starttimefrom[$activitytime]) === FALSE) {
复制代码
替换为
- } elseif(strtotime($starttimefrom[$activitytime]) === -1 || @strtotime($starttimefrom[$activitytime]) === FALSE) {
复制代码
找
- } elseif(strtotime($starttimefrom[$activitytime]) < $timestamp) {
复制代码
替换为
- } elseif(@strtotime($starttimefrom[$activitytime]) < $timestamp) {
复制代码
找
- } elseif($activitytime && ((strtotime($starttimefrom) > strtotime($starttimeto) || !$starttimeto))) {
复制代码
替换为
- } elseif($activitytime && ((@strtotime($starttimefrom) > @strtotime($starttimeto) || !$starttimeto))) {
复制代码
找
- } elseif(trim($activityexpiration) && (strtotime($activityexpiration) === -1 || strtotime($activityexpiration) === FALSE)) {
复制代码
替换为
- } elseif(trim($activityexpiration) && (@strtotime($activityexpiration) === -1 || @strtotime($activityexpiration) === FALSE)) {
复制代码
找
- $activity['starttimefrom'] = strtotime($starttimefrom[$activitytime]);
- $activity['starttimeto'] = $activitytime ? strtotime($starttimeto) : 0;
复制代码
替换为
- $activity['starttimefrom'] = @strtotime($starttimefrom[$activitytime]);
- $activity['starttimeto'] = $activitytime ? @strtotime($starttimeto) : 0;
复制代码
找
- $activity['expiration'] = strtotime($activityexpiration);
复制代码
替换为
- $activity['expiration'] = @strtotime($activityexpiration);
复制代码
找
- while($attach = $db->fetch_array($query)) {
- $attachpermadd = $allowsetattachperm && $attach['readperm'] != $attachpermnew[$attach['aid']] ? ", readperm='{$attachpermnew[$attach['aid']]}'" : '' ;
- $attachpricenew[$attach['aid']] = intval($attachpricenew[$attach['aid']]);
- $attachpriceadd = $maxprice && $attach['price'] != $attachpricenew[$attach['aid']] && $attachpricenew[$attach['aid']] <= $maxprice ? ", price='{$attachpricenew[$attach['aid']]}'" : '' ;
- $attachdescnew[$attach['aid']] = cutstr(dhtmlspecialchars($attachdescnew[$attach['aid']]), 100);
复制代码
替换为
- $attachdescnew = is_array($attachdescnew) ? $attachdescnew : array();
- $attachpermnew = is_array($attachpermnew) ? $attachpermnew : array();
- $attachpricenew = is_array($attachpricenew) ? $attachpricenew : array();
- while($attach = $db->fetch_array($query)) {
- $attachpermnew[$attach['aid']] = intval($attachpermnew[$attach['aid']]);
- $attachpermadd = $allowsetattachperm && $attach['readperm'] != $attachpermnew[$attach['aid']] ? ", readperm='{$attachpermnew[$attach['aid']]}'" : '' ;
- $attachpricenew[$attach['aid']] = intval($attachpricenew[$attach['aid']]);
- $attachpriceadd = $maxprice && $attach['price'] != $attachpricenew[$attach['aid']] && $attachpricenew[$attach['aid']] <= $maxprice ? ", price='{$attachpricenew[$attach['aid']]}'" : '' ;
- $attachdescnew[$attach['aid']] = cutstr(dhtmlspecialchars($attachdescnew[$attach['aid']]), 95);
复制代码
找
- if(!empty($uattachments)) {
复制代码
替换为
- if($uattachment && !empty($uattachments)) {
复制代码
找
- $db->query("DELETE FROM {$tablepre}attachments WHERE aid IN ($deleteaids)");
复制代码
替换为
- $db->query("DELETE FROM {$tablepre}attachments WHERE aid IN ($deleteaids) AND pid='$pid'");
复制代码
找
- $db->query("DELETE FROM {$tablepre}threadsmod WHERE tid='$tid'", 'UNBUFFERED');
- $db->query("DELETE FROM {$tablepre}relatedthreads WHERE tid='$tid'", 'UNBUFFERED');
- $db->query("DELETE FROM {$tablepre}threads WHERE tid='$tid'", 'UNBUFFERED');
- $db->query("DELETE FROM {$tablepre}polloptions WHERE tid='$tid'");
- $db->query("DELETE FROM {$tablepre}polls WHERE tid='$tid'", 'UNBUFFERED');
- $db->query("DELETE FROM {$tablepre}mythreads WHERE tid='$tid'", 'UNBUFFERED');
复制代码
替换为
- $tablearray = array('threadsmod','relatedthreads','threads','polloptions','polls','mythreads');
- foreach ($tablearray as $table) {
- $db->query("DELETE FROM {$tablepre}$table WHERE tid='$tid'", 'UNBUFFERED');
- }
复制代码
找
- $query = $db->query("SELECT author, dateline FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline DESC LIMIT 1");
- $lastpost = $db->fetch_array($query);
- $lastpost['author'] = addslashes($lastpost['author']);
复制代码
替换为
- $query = $db->query("SELECT author, dateline, anonymous FROM {$tablepre}posts WHERE tid='$tid' AND invisible='0' ORDER BY dateline DESC LIMIT 1");
- $lastpost = $db->fetch_array($query);
- $lastpost['author'] = !$lastpost['anonymous'] ? addslashes($lastpost['author']) : '';
复制代码
global.func.php
找
- if($addcredits * $coef < 0 && $GLOBALS['extcredits'.$id] - $addcredits < $extcredits[$id]['lowerlimit']) {
复制代码
替换为
- if($addcredits * $coef < 0 && ($GLOBALS['extcredits'.$id] < $extcredits[$id]['lowerlimit'] || (($GLOBALS['extcredits'.$id] - $addcredits) < $extcredits[$id]['lowerlimit']))) {
复制代码
找
- function formhash() {
- global $discuz_user, $discuz_uid, $discuz_pw, $timestamp, $discuz_auth_key;
- return substr(md5(substr($timestamp, 0, -7).$discuz_user.$discuz_uid.$discuz_pw.$discuz_auth_key), 8, 8);
- }
复制代码
替换为
- function formhash($specialadd = '') {
- global $discuz_user, $discuz_uid, $discuz_pw, $timestamp, $discuz_auth_key;
- $hashadd = defined('IN_ADMINCP') ? 'Only For Discuz! Admin Control Panel' : '';
- return substr(md5(substr($timestamp, 0, -7).$discuz_user.$discuz_uid.$discuz_pw.$discuz_auth_key.$hashadd.$specialadd), 8, 8);
- }
复制代码
找
- $updatearray[] = "credits='$credits'";
复制代码
下面添加
- $member['credits'] = $credits;
复制代码
找
- if(($periodbegin > $periodend && ($now >= $periodbegin || $now < $periodend)) || ($oeriodbegin < $periodend && $now >= $periodbegin && $now < $periodend)) {
复制代码
替换为
- if(($periodbegin > $periodend && ($now >= $periodbegin || $now < $periodend)) || ($periodbegin < $periodend && $now >= $periodbegin && $now < $periodend)) {
复制代码
找
- header("Content-type: application/xml");
复制代码
替换为
- header("Content-type: application/xml; charset=$charset");
- //header('Content-Type: text/html; charset='.$charset);
复制代码
找
下面添加
- if(empty($supe['status'])) {
- return;
- }
复制代码
misc.func.php
找
- global $dateformat, $timeformat, $timeoffset, $ppp, $colorarray;
复制代码
替换为
- global $dateformat, $timeformat, $timeoffset, $ppp, $colorarray, $_DCACHE;
复制代码
找
- $db->query("UPDATE $tablepre$table SET $viewscol=$viewscol+$views WHERE $idcol IN (0$ids)", 'UNBUFFERED');
复制代码
替换为
- $db->query("UPDATE LOW_PRIORITY $tablepre$table SET $viewscol=$viewscol+'$views' WHERE $idcol IN (0$ids)", 'UNBUFFERED');
复制代码
newthread.inc.php
找
- checklowerlimit($postcredits);
复制代码
替换为
- if($url && $qihoo_relate_webnum) {
- if($data = @implode('', file("http://search.qihoo.com/sint/content.html?surl=$url&ocs=$charset&ics=$charset"))) {
- $parser = xml_parser_create();
- xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
- xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
- xml_parse_into_struct($parser, $data, $values, $index);
- xml_parser_free($parser);
- if(PHP_VERSION > '5' && $charset != 'utf-8') {
- require_once DISCUZ_ROOT.'./include/chinese.class.php';
- $chs = new Chinese('utf-8', $charset);
- }
- $subject = !empty($chs) ? $chs->convert($values[$index['title'][0]]['value']) : $values[$index['title'][0]]['value'];
- $message = !empty($chs) ? $chs->convert($values[$index['content'][0]]['value']) : $values[$index['content'][0]]['value'];
- $message = str_replace('<br>', "\n", $message);
- }
- }
复制代码
找
- if(isset($poll)) {
- $special = 1;
- } elseif(isset($trade)) {
- $special = 2;
- } elseif(isset($reward)) {
- $special = 3;
- } elseif(isset($activity)) {
- $special = 4;
- } else {
- $special = 0;
- }
复制代码
替换为
- checklowerlimit($postcredits);
- if(isset($poll) && $allowpostpoll) {
- $special = 1;
- } elseif(isset($trade) && $allowposttrade) {
- $special = 2;
- } elseif(isset($reward) && $allowpostreward) {
- $special = 3;
- } elseif(isset($activity) && $allowpostactivity) {
- $special = 4;
- } else {
- $special = 0;
- }
复制代码
找
替换为
- if(!$value = trim($value)) {
复制代码
找
- } elseif(count($polloptions) == 1) {
复制代码
替换为
- } elseif(count($polloptions) < 2) {
复制代码
找
替换为
找
- } elseif($special == 4 && $allowpostactivity) {
复制代码
替换为
- } elseif($special == 4) {
复制代码
找
- } elseif(strtotime($starttimefrom[$activitytime]) === -1 || strtotime($starttimefrom[$activitytime]) === FALSE) {
复制代码
替换为
- } elseif(@strtotime($starttimefrom[$activitytime]) === -1 || @strtotime($starttimefrom[$activitytime]) === FALSE) {
复制代码
找
- } elseif(strtotime($starttimefrom[$activitytime]) < $timestamp) {
复制代码
替换为
- } elseif(@strtotime($starttimefrom[$activitytime]) < $timestamp) {
复制代码
找
- } elseif($activitytime && ((strtotime($starttimefrom) > strtotime($starttimeto) || !$starttimeto))) {
复制代码
替换为
- } elseif($activitytime && ((@strtotime($starttimefrom) > @strtotime($starttimeto) || !$starttimeto))) {
复制代码
找
- } elseif(trim($activityexpiration) && (strtotime($activityexpiration) === -1 || strtotime($activityexpiration) === FALSE)) {
复制代码
替换为
- } elseif(trim($activityexpiration) && (@strtotime($activityexpiration) === -1 || @strtotime($activityexpiration) === FALSE)) {
复制代码
找
- $activity['starttimefrom'] = strtotime($starttimefrom[$activitytime]);
- $activity['starttimeto'] = $activitytime ? strtotime($starttimeto) : 0;
复制代码
替换为
- $activity['starttimefrom'] = @strtotime($starttimefrom[$activitytime]);
- $activity['starttimeto'] = $activitytime ? @strtotime($starttimeto) : 0;
复制代码
找
- $activity['expiration'] = strtotime($activityexpiration);
复制代码
替换为
- $activity['expiration'] = @strtotime($activityexpiration);
复制代码
找
- $query = $supe['db']->query("UPDATE {$supe[tablepre]}groups SET lastpost='$timestamp' WHERE gid='$sgid'");
复制代码
替换为
- $query = $supe['db']->query("UPDATE {$supe[tablepre]}groups SET lastpost='$timestamp' WHERE gid='$sgid'", 'SILENT');
复制代码
找
- showmessage('post_newthread_succeed', "viewthread.php?tid=$tid&extra=$extra");
复制代码
替换为
- showmessage('post_newthread_succeed', "viewthread.php?tid=$tid&extra=$extra".(!empty($frombbs) ? "&frombbs=$frombbs" : ''));
复制代码
post.func.php
找
- $attachments = $attacharray = array();
复制代码
下面添加
- static $safeext = array('jpg', 'jpeg', 'gif', 'png', 'swf', 'bmp', 'txt', 'zip', 'rar', 'doc', 'mp3');
- static $imgext = array('jpg', 'gif', 'png', 'bmp');
复制代码
找
- $attach['ext'] = $extension = strtolower(fileext($attach['name']));
- if(substr($attach['type'], 0, 5) == 'image') {
- $attach['isimage'] = 1;
- } else {
- $attach['isimage'] = 0;
- }
复制代码
替换为
- $attach['ext'] = strtolower(fileext($attach['name']));
- $extension = in_array($attach['ext'], $safeext) ? $attach['ext'] : 'attach';
- if(in_array($attach['ext'], $imgext)) {
- $attach['isimage'] = 1;
- }else{
- $attach['isimage'] = 0;
- }
复制代码
找
- $attach['name'] = 'abbr_'.md5($attach['name']).'.'.$extension;
复制代码
替换为
- $attach['name'] = 'abbr_'.md5($attach['name']).'.'.$attach['ext'];
复制代码
找
- $target = $attachdir.'/'.stripslashes($attach['attachment']);
复制代码
替换为
- if(in_array($attachinfo['mime'], array('image/jpeg', 'image/gif', 'image/png'))) {
- if($thumbstatus) {
复制代码
找
- if(in_array($attachinfo['mime'], array('image/jpeg', 'image/gif', 'image/png'))) {
复制代码
替换为
- $imagecreatefromfunc = $imagefunc = '';
- switch($attachinfo['mime']) {
- case 'image/jpeg':
- $imagecreatefromfunc = function_exists('imagecreatefromjpeg') ? 'imagecreatefromjpeg' : '';
- $imagefunc = function_exists('imagejpeg') ? 'imagejpeg' : '';
- break;
- case 'image/gif':
- $imagecreatefromfunc = function_exists('imagecreatefromgif') ? 'imagecreatefromgif' : '';
- $imagefunc = function_exists('imagegif') ? 'imagegif' : '';
- break;
- case 'image/png':
- $imagecreatefromfunc = function_exists('imagecreatefrompng') ? 'imagecreatefrompng' : '';
- $imagefunc = function_exists('imagepng') ? 'imagepng' : '';
- break;
- }
- if($imagecreatefromfunc && $imagefunc) {
- if($thumbstatus && function_exists('imagecreatetruecolor') && function_exists('imagecopyresampled') && function_exists('imagejpeg')) {
复制代码
找
- switch($attachinfo['mime']) {
- case 'image/jpeg':
- $attach_photo = imageCreateFromJPEG($target);
- break;
- case 'image/gif':
- $attach_photo = imageCreateFromGIF($target);
- break;
- case 'image/png':
- $attach_photo = imageCreateFromPNG($target);
- break;
- }
复制代码
替换为
- $attach_photo = $imagecreatefromfunc($target);
复制代码
找
- if($watermarkstatus) {
- $watermarkinfo = @getimagesize($watermark_file);
- $watermark_logo = $watermarktype ? imageCreateFromPNG($watermark_file) : imageCreateFromGIF($watermark_file);
复制代码
替换为
- if($watermarkstatus && function_exists('imagecopy') && function_exists('imagealphablending') && function_exists('imagecopymerge')) {
- $watermarkinfo = @getimagesize($watermark_file);
- $watermark_logo = $watermarktype ? @imageCreateFromPNG($watermark_file) : @imageCreateFromGIF($watermark_file);
复制代码
找
- if(is_readable($watermark_file) && $wmwidth > 10 && $wmheight > 10 && !$animatedgif) {
- switch($attachinfo['mime']) {
- case 'image/jpeg':
- $dst_photo = imageCreateFromJPEG($target);
- break;
- case 'image/gif':
- $dst_photo = imageCreateFromGIF($target);
- break;
- case 'image/png':
- $dst_photo = imageCreateFromPNG($target);
- break;
- }
复制代码
替换为
- if(is_readable($watermark_file) && $wmwidth > 10 && $wmheight > 10 && !$animatedgif && $watermark_logo) {
- $dst_photo = @$imagecreatefromfunc($target);
复制代码
找
- switch($attachinfo['mime']) {
- case 'image/jpeg':
- imageJPEG($dst_photo, $target, $watermarkquality);
- break;
- case 'image/gif':
- imageGIF($dst_photo, $target);
- break;
- case 'image/png':
- imagePNG($dst_photo, $target);
- break;
复制代码
替换为
- if($attachinfo['mime'] == 'image/jpeg') {
- $imagefunc($dst_photo, $target, $watermarkquality);
- } else {
- $imagefunc($dst_photo, $target);
复制代码 |