View Full Version : Solved Captured another 4.2.5 VB with VBET error
Was getting another warning so I created a error reporting to write the template to the log and captured this...
[04-Jun-2018 18:52:57 UTC] $lastpostinfo['lastposter'] = '<!--vBET_SNTA-->' . $lastpostinfo['lastposter'] .'<!--vBET_ENTA-->';
[04-Jun-2018 18:52:57 UTC] PHP Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /home/allfreec/public_html/phpBB2/includes/class_core.php(4695) : eval()'d code on line 1
What I did was write the template to the log before it failed, took me 3 days but this is the template loading that is throwing the error.
We will investigate it and send you response soon.
We must have different versions of vBulletin because in place described by error log we have } and there should be some plugin execution.
Please give us content of line 4695 in your file /home/allfreec/public_html/phpBB2/includes/class_core.php so we will be able to find which plugin is guilty and look for bug.
Starting at 4660, you can see my code to catch the error to the log file throwing off the actual
/**
* 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 . '";');
}
Thanks. And this commented code is your code, which returned 1st line of error log?
Yes, it would log any template executed, that did not match the two know ones that it was logging. Then it would write the ytemple to the log then be followed by the error message
NOt sure if that made sense, I logged every single template load there, then removed them if they did not cause the error with the str replace check.
Thanks. And this commented code is your code, which returned 1st line of error log?
error_log($template_code, 0); <- this line writes current $template_code to the log file
As the error is fatal, I had to to write each template code processed, then see what it was before the fatal error is recorded.
$lastpostinfo['lastposter'] = '<!--vBET_SNTA-->' . $lastpostinfo['lastposter'] .'<!--vBET_ENTA-->';
There is no such code in vBET... Did you made any changes in code? Which version do you have (maybe some older)?
Must be another template that is using the VBET name in there as no changes are made to VBET 492.
So maybe this code is generated by adding several parts (in loop or some other expression). I will check again, looking just for part of it and let you know.
OK, I found it. I couldn't find it earlier, because in code we have escape characters before '. The code is in file vbenterprisetranslator_functions_hooks.php
$vbulletin->templatecache['forumhome_lastpostby'] =
'$lastpostinfo[\'lastposter\'] = \'<!--vBET_SNTA-->\' . $lastpostinfo[\'lastposter\'] .\'<!--vBET_ENTA-->\';'
.$vbulletin->templatecache['forumhome_lastpostby'];
I cannot reproduce the issue so I'm not able to check solution. Please describe how to reproduce or try to replace the code with the one below. This solution was not checked.
$vbulletin->templatecache['forumhome_lastpostby'] =
'$lastpostinfo[lastposter] = \'<!--vBET_SNTA-->\' . $lastpostinfo[lastposter] .\'<!--vBET_ENTA-->\';'
.$vbulletin->templatecache['forumhome_lastpostby'];
This can be it - error code tells about unexpected ' and since vBulletin puts our code in " (eval('$final_rendered = "' . $template_code . '";');) this could lead to the error. Please tell us, how to reproduce, or check possible solution and send us your status.
I can not force the error, i was only able to capture it.. It does happen at least a few times in a couple of days so I will update the code and watch!
Great - we will wait for your info.
So far no errors, Looks good
Great. I will mark this bug as solved and include solution in next release. If problems appear again, please let us know.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.