diff --git a/upload/source/class/class_credit.php b/upload/source/class/class_credit.php index 1941b26636032f4a3255aa91a07e0ed3f1ec0184..ebc7852d52a138911c07614fc081933eaaf8ed35 100644 --- a/upload/source/class/class_credit.php +++ b/upload/source/class/class_credit.php @@ -225,7 +225,7 @@ class credit { if(isset($_G['setting']['extcredits'][$i])) { $creditarr['extcredits'.$i] = intval($rule['extcredits'.$i]) * $this->coef; if(defined('IN_MOBILE') && $creditarr['extcredits'.$i] > 0) { - $creditarr['extcredits'.$i] += $_G['setting']['creditspolicymobile']; + $creditarr['extcredits'.$i] += (int)$_G['setting']['creditspolicymobile']; } $updatecredit = true; } diff --git a/upload/source/class/class_template.php b/upload/source/class/class_template.php index d1fd45ebf0cd07e04a0cf456c300bd45ac6a5b15..abc1b4abb82513ed6ae0219ce11c113a62ff22b1 100644 --- a/upload/source/class/class_template.php +++ b/upload/source/class/class_template.php @@ -28,10 +28,11 @@ class template { $this->file = $file; if($fp = @fopen(DISCUZ_ROOT.$tplfile, 'r')) { - $template = @fread($fp, filesize(DISCUZ_ROOT.$tplfile)); + $template = filesize(DISCUZ_ROOT.$tplfile) ? fread($fp, filesize(DISCUZ_ROOT.$tplfile)) : ''; fclose($fp); } elseif($fp = @fopen($filename = substr(DISCUZ_ROOT.$tplfile, 0, -(strlen($this->filetype) + 1)).'.php', 'r')) { - $template = $this->getphptemplate(@fread($fp, filesize($filename))); + $template = filesize($filename) ? fread($fp, filesize($filename)) : ''; + $template = $this->getphptemplate($template); fclose($fp); } else { $tpl = $tpldir.'/'.$file.'.'.$this->filetype; diff --git a/upload/source/function/cache/cache_setting.php b/upload/source/function/cache/cache_setting.php index 025efcd71f3762ca8ee3671dd4767abc6aa62a12..fa09909eec49487fbe83211dad3e89897e20bdfe 100644 --- a/upload/source/function/cache/cache_setting.php +++ b/upload/source/function/cache/cache_setting.php @@ -1123,10 +1123,10 @@ function writetojscache() { '', )); while(($entry = readdir($dh)) !== false) { - if(fileext($entry) == 'js') { + if(fileext($entry) == 'js' && filesize($dir.$entry)) { $jsfile = $dir.$entry; $fp = fopen($jsfile, 'r'); - $jsdata = @fread($fp, filesize($jsfile)); + $jsdata = fread($fp, filesize($jsfile)); fclose($fp); $jsdata = preg_replace($remove[0], $remove[1], $jsdata); if(file_put_contents(DISCUZ_ROOT.'./data/cache/'.$entry, $jsdata, LOCK_EX) === false) { diff --git a/upload/source/function/function_upload.php b/upload/source/function/function_upload.php index e6ea37d17701ba7f3a22d637962df9b87b6a19f1..1485ef48b38e0c34e60741c4c98d3c2ed89bc0dc 100644 --- a/upload/source/function/function_upload.php +++ b/upload/source/function/function_upload.php @@ -86,7 +86,7 @@ function getuploadconfig($uid=0, $fid=0, $limit=true) { if($limit) { if($_G['group']['maxattachnum']) { $todayattachs = getuserprofile('todayattachs'); - $config['maxattachnum'] = $_G['group']['maxattachnum'] - $todayattachs; + $config['maxattachnum'] = (int)$_G['group']['maxattachnum'] - (int)$todayattachs; $config['maxattachnum'] = $config['maxattachnum'] > 0 ? $config['maxattachnum'] : -1; $config['limit'] = $config['maxattachnum'] > 0 ? $config['maxattachnum'] : 0; } diff --git a/upload/source/module/forum/forum_guide.php b/upload/source/module/forum/forum_guide.php index e61dda0d600345c11141763340237513370928a9..cb5d6d04d257a604f046e042653c8e9fbf440f93 100644 --- a/upload/source/module/forum/forum_guide.php +++ b/upload/source/module/forum/forum_guide.php @@ -180,6 +180,7 @@ function get_guide_list($view, $start = 0, $num = 50, $again = 0) { $updatecache = true; } $query = C::t('forum_thread')->fetch_all_for_guide($view, $limittid, $tids, $_G['setting']['heatthread']['guidelimit'], $dateline); + $list = array(); $n = 0; foreach($query as $thread) { if(empty($tids) && ($thread['isgroup'] || !in_array($thread['fid'], $fids))) { diff --git a/upload/source/module/forum/forum_viewthread.php b/upload/source/module/forum/forum_viewthread.php index fc1618ed413a9d03c14abeb0b6ed68b5691be80a..e614bd425bfbb6cbf26b77fccc1ce4c82e245f4e 100644 --- a/upload/source/module/forum/forum_viewthread.php +++ b/upload/source/module/forum/forum_viewthread.php @@ -543,7 +543,7 @@ if($maxposition) { $postarr[$post['position']] = $post; $lastposition = $post['position']; } - $realpost = count($postarr); + $realpost = is_array($postarr) ? count($postarr) : 0; if($realpost != $_G['ppp'] || $have_badpost) { $k = 0; for($i = $start; $i < $end; $i ++) { diff --git a/upload/source/module/portal/portal_attachment.php b/upload/source/module/portal/portal_attachment.php index 6b2afe9dc5bb3ce2800475de586e87cf4bd6ac57..e314ff9dc0dd017168a8844f1e03273470e1eb8b 100644 --- a/upload/source/module/portal/portal_attachment.php +++ b/upload/source/module/portal/portal_attachment.php @@ -115,8 +115,8 @@ function getlocalfile($filename, $readmod = 2, $range = 0) { @fseek($fp, $range); if(function_exists('fpassthru') && ($readmod == 3 || $readmod == 4)) { @fpassthru($fp); - } else { - echo @fread($fp, filesize($filename)); + } else if(filesize($filename)) { + echo fread($fp, filesize($filename)); } } @fclose($fp); diff --git a/upload/template/default/forum/activity_applist_more.htm b/upload/template/default/forum/activity_applist_more.htm index 7a105bc13f6d71c2b289d795c7f3d7f2ad458e05..9a9a07b82f448e4bbe22c0cc43058b96c1bf9863 100644 --- a/upload/template/default/forum/activity_applist_more.htm +++ b/upload/template/default/forum/activity_applist_more.htm @@ -13,7 +13,7 @@
$apply[message]
+ |
UID: $member[uid] @@ -84,7 +84,7 @@ |
|