查看完整版本: 已解决 捕获另一个 4.2.5 VB VBET 错误
正在得到另一个警告, 所以我创建了一个错误报告, 将模板写入日志, 并捕获了这个..。
[04-Jun-2018 18:52:57 UTC] $lastpostinfo['lastposter'] = '' . $lastpostinfo['lastposter'] .'';
[04-2018年6月 18:52:57 UTC]php 分析错误: 语法错误, 意外的 "(T_ENCAPSED_AND_WHITESPACE), 期望标识符 (T_STRING) 或变量 (T_VARIABLE) 或数字 (T_NUM_STRING) 在/首页/allfreec/public_html/phpBB2/包括/class_core. php (4695): eval () 1 行上的代码
我所做的是在它失败之前将模板写入日志, 花了我3天, 但这是正在抛出错误的模板加载。
我们必须有不同的版本的 vBulletin, 因为在地方被错误日志描述我们有}, 应该有一些插件执行。
请给我们在您的文件4695行的内容 /home/allfreec/public_html/phpBB2/includes/class_core.php 因此, 我们将能够找到哪个插件是有罪的, 并寻找 bug。
从4660开始, 您可以看到我的代码, 以捕捉错误的日志文件抛出实际
/**
* Renders the output after preperation.
* @see vB_Template::render()
*
* @param boolean Whether to suppress the HTML comment surrounding option (for JS, etc)
* @return string
*/
protected function render_output($suppress_html_comments = false)
{
//This global statement is here to expose $vbulletin to the templates.
//It must remain in the same function as the template eval
global $vbulletin;
extract($this->registered, EXTR_SKIP | EXTR_REFS);
$actioned = false;
($hook = vBulletinHook::fetch_hook('template_render_output')) ? eval($hook) : false;
if (!$actioned)
{
$template_code = self::fetch_template($this->template);
}
if (strpos($template_code, '$final_rendered') !== false)
{
eval($template_code);
}
else
{
/*
$tcount = 0;
$tst = str_replace("vB_Template_Runtime::fetchStylevar('outertablewidth')","",$template_code,$tcount);
$tst = str_replace("old_explorer","",$template_code,$mcount);
if ($mcount==0&&$tcount==0){
error_log($template_code, 0);
}
*/
eval('$final_rendered = "' . $template_code . '";');
}
谢谢。此注释代码是您的代码, 它返回了错误日志的第一行?
是的, 它会记录执行的任何模板, 这与它正在记录的两个已知的不匹配。 然后, 它会写 ytemple 到日志, 然后再跟着错误消息
不确定是否有意义, 我记录了每一个模板加载在那里, 然后删除它们, 如果他们没有导致错误的 str 替换检查。
谢谢。此注释代码是您的代码, 它返回了错误日志的第一行?
error_log ($template _code, 0);<-此行将当前 $template _code 写入日志文件
由于错误是致命的, 所以我必须编写处理的每个模板代码, 然后在记录致命错误之前查看它的内容。
$lastpostinfo['lastposter'] = '' . $lastpostinfo['lastposter'] .'';
vBET 中没有这样的代码..。您是否在代码中进行了任何更改?你有哪个版本 (也许有些老了)?
必须是另一个使用 VBET 名称的模板, 因为没有对 VBET 492 进行任何更改。
因此, 可能通过添加多个部分 (在循环或其他表达式中) 生成此代码。我会再次检查, 寻找只是其中的一部分, 让你知道。
好的, 我找到了。我以前找不到它, 因为在代码中我们有转义字符。代码在文件中 vbenterprisetranslator_functions_hooks.php
$vbulletin->templatecache['forumhome_lastpostby'] =
'$lastpostinfo[\'lastposter\'] = \'\' . $lastpostinfo[\'lastposter\'] .\'\\';“
. $vbulletin > templatecache [' forumhome_lastpostby '];
无法重现此问题, 因此无法检查解决方案。请描述如何重现或尝试用下面的代码替换。未检查此解决方案。
$vbulletin->templatecache['forumhome_lastpostby'] =
'$lastpostinfo[lastposter] = \'\' . $lastpostinfo[lastposter] .\'\\';“
. $vbulletin > templatecache [' forumhome_lastpostby '];
这可能是它-错误代码告诉关于意想不到的 ', 并且, 因为 vBulletin 投入我们的代码 in "(eval('$final_rendered = "' . $template_code . '";');) 这可能导致错误。请告诉我们, 如何重现, 或检查可能的解决方案, 并发送给我们您的状态。
我不能强迫的错误, 我只能够捕捉它。 它至少在几天内发生几次, 所以我会更新代码和观看!
伟大。我会将此 bug 标记为已解决, 并在下一版本中包含解决方案。如果问题再次出现, 请让我们知道。
Automatic Translations (Powered by Google, Microsoft®,
Yandex, SDL Language Cloud, IBM Watson and Apertium):
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.