PDA

查看完整版本: 已解決 捕獲另一個 4.2.5 VB VBET 錯誤



ctrenks
04-06-18, 20:49
正在得到另一個警告, 所以我創建了一個錯誤報表, 將範本寫入日誌, 並捕獲了這個..。



[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天, 但這是正在拋出錯誤的範本載入。

vBET
07-06-18, 01:16
我們將調查它, 並儘快給你答覆。

vBET
15-06-18, 19:56
我們必須有不同的版本的 vBulletin, 因為在地方被錯誤日誌描述我們有}, 應該有一些外掛程式執行。
請給我們在您的檔4695行的內容 /home/allfreec/public_html/phpBB2/includes/class_core.php 因此, 我們將能夠找到哪個外掛程式是有罪的, 並尋找 bug。

ctrenks
17-06-18, 02:11
從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 . '";');
}

vBET
18-06-18, 18:01
謝謝。此注釋代碼是您的代碼, 它返回了錯誤日誌的第一行?

ctrenks
18-06-18, 18:16
是的, 它會記錄執行的任何範本, 這與它正在記錄的兩個已知的不匹配。 然後, 它會寫 ytemple 到日誌, 然後再跟著錯誤訊息

ctrenks
18-06-18, 18:55
不確定是否有意義, 我記錄了每一個範本載入在那裡, 然後刪除它們, 如果他們沒有導致錯誤的 str 替換檢查。

ctrenks
19-06-18, 16:33
謝謝。此注釋代碼是您的代碼, 它返回了錯誤日誌的第一行?

error_log ($template _code, 0);<-此行將當前 $template _code 寫入日誌檔

由於錯誤是致命的, 所以我必須編寫處理的每個範本代碼, 然後在記錄致命錯誤之前查看它的內容。

vBET
21-06-18, 17:06

$lastpostinfo['lastposter'] = '' . $lastpostinfo['lastposter'] .'“;
vBET 中沒有這樣的代碼..。您是否在代碼中進行了任何更改?你有哪個版本 (也許有些老了)?

ctrenks
22-06-18, 14:50
必須是另一個使用 VBET 名稱的範本, 因為沒有對 VBET 492 進行任何更改。

vBET
22-06-18, 16:05
因此, 可能通過添加多個部分 (在迴圈或其他運算式中) 生成此代碼。我會再次檢查, 尋找只是其中的一部分, 讓你知道。

vBET
23-06-18, 19:03
好的, 我找到了。我以前找不到它, 因為在代碼中我們有逸出字元。代碼在檔中 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 . '";');) 這可能導致錯誤。請告訴我們, 如何重現, 或檢查可能的解決方案, 併發送給我們您的狀態。

ctrenks
25-06-18, 14:31
我不能強迫的錯誤, 我只能夠捕捉它。 它至少在幾天內發生幾次, 所以我會更新代碼和觀看!

vBET
26-06-18, 10:05
好極了-我們會等你的資訊。

ctrenks
27-06-18, 21:38
到目前為止沒有錯誤, 看起來好

vBET
30-06-18, 09:15
偉大。我會將此 bug 標記為已解決, 並在下一版本中包含解決方案。如果問題再次出現, 請讓我們知道。

Automatic Translations (Powered by Google, Microsoft®, Yandex, SDL Language Cloud, IBM Watson and Apertium):
AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Translated to other languages thanks to vB Enterprise Translator 4.10.1