返回列表 发帖
查看: 4836|回复: 3

[已关闭] Discuz! X3.4 R20191201 GBK 帖子报错500的问题

1

主题

5

回帖

15

积分

初学乍练

贡献
0 点
金币
9 个
发表于 2019-12-25 15:01:35 | 显示全部楼层 |阅读模式
BUG反馈
程序版本: X3.4
浏览器:  
BUG地址: 隐藏内容
BUG截图: -
测试用户名: 隐藏内容
测试密码: 隐藏内容
\source\module\forum\forum_viewthread.php

1300行左右的这个函数好像有问题。注释了就正确,是不是写法有问题。


                        ob_start(function($input) use (&$filemtime) {
                                return replace_formhash($filemtime, $input);
                        });

我知道答案 回答被采纳将会获得1 贡献 已有3人回答
回复

使用道具 举报

1

主题

5

回帖

15

积分

初学乍练

贡献
0 点
金币
9 个
 楼主| 发表于 2019-12-25 15:02:53 | 显示全部楼层
function($input) use (&$filemtime)  有USE这写法么?
回复 支持 反对

使用道具 举报

1

主题

5

回帖

15

积分

初学乍练

贡献
0 点
金币
9 个
 楼主| 发表于 2019-12-25 15:22:26 | 显示全部楼层
  1. function callback_formhash($input,&$filemtime){
  2.     return replace_formhash($filemtime, $input);
  3. }


  4. ob_start("callback_formhash");
复制代码


应该是这样。
回复 支持 反对

使用道具 举报

1

主题

5

回帖

15

积分

初学乍练

贡献
0 点
金币
9 个
 楼主| 发表于 2019-12-25 15:23:44 | 显示全部楼层
  1. function callback_formhash($input,&$filemtime){
  2.     return replace_formhash($filemtime, $input);
  3. }

  4. function viewthread_loadcache() {
  5.         global $_G;
  6.         $_G['thread']['livedays'] = ceil((TIMESTAMP - $_G['thread']['dateline']) / 86400);
  7.         $_G['thread']['lastpostdays'] = ceil((TIMESTAMP - $_G['thread']['lastpost']) / 86400);

  8.         $threadcachemark = 100 - (
  9.                 $_G['thread']['digest'] * 20 +
  10.                 min($_G['thread']['views'] / max($_G['thread']['livedays'], 10) * 2, 50) +
  11.                 max(-10, (15 - $_G['thread']['lastpostdays'])) +
  12.                 min($_G['thread']['replies'] / $_G['setting']['postperpage'] * 1.5, 15));
  13.         if($threadcachemark < $_G['forum']['threadcaches']) {

  14.                 $threadcache = getcacheinfo($_G['tid']);

  15.                 if(TIMESTAMP - $threadcache['filemtime'] > $_G['setting']['cachethreadlife']) {
  16.                         @unlink($threadcache['filename']);
  17.                         define('CACHE_FILE', $threadcache['filename']);
  18.                 } else {
  19.                         $start_time = microtime(TRUE);
  20.                         $filemtime = $threadcache['filemtime'];
  21.                         ob_start("callback_formhash");
  22.                         readfile($threadcache['filename']);
  23.                         viewthread_updateviews($_G['forum_thread']['threadtableid']);
  24.                         $updatetime = dgmdate($filemtime, 'Y-m-d H:i:s');
  25.                         $gzip = $_G['gzipcompress'] ? ', Gzip On' : '';
  26.                         echo '<script type="text/javascript">$("debuginfo") ? $("debuginfo").innerHTML = ", Updated at '.$updatetime.', Processed in '.sprintf("%0.6f", microtime(TRUE) - $start_time).' second(s)'.$gzip.'." : "";</script></body></html>';
  27.                         ob_end_flush();
  28.                         exit();
  29.                 }
  30.         }
  31. }
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2024-4-19 03:48 , Processed in 0.041689 second(s), 9 queries , Redis On.

Powered by Discuz! W1.0 Licensed

Cpoyright © 2001-2024 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表