關於tag解析出錯的補丁
適應版本:Discuz!6.0.0(0904版本)
修正問題:查看帖子的時候出現諸如php?name=%B5%C8%C0%EB%D7%D3" onclick="tagshow(event)" class="t_tag">的多餘內容
修正方法:
1.打開viewthread.php
查找$postlist[$firstpid]['message'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$_DCACHE, '\\1')", $postlist[$firstpid]['message']);改為 $postlist[$firstpid]['message'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$_DCACHE, '\\1')", $postlist[$firstpid]['message']);
$postlist[$firstpid]['message'] = preg_replace('#(.*)#siUe', "'\\1'", $postlist[$firstpid]['message']);2.打開include/discuzcode.func.php
查找$message = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$highlightarray, '\\1', 0)", $message);改為$message = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$highlightarray, '\\1', 0)", $message);
$message = preg_replace('#(.*)#siU', "\\1", $message);查找global $_DCACHE;
if($_DCACHE['tags'][$key] && @strexists($text, $replaceword)) {
$text = str_replace($replaceword, ''.$replaceword.'', $text);
unset($_DCACHE['tags'][$key]);
}
} else {
$text = str_replace($replaceword, ''.$replaceword.'', $text);
}改為global $_DCACHE;
if($_DCACHE['tags'][$key] && @strexists($text, $replaceword)) {
$text = str_replace($replaceword, ''.$replaceword.'', $text);
unset($_DCACHE['tags'][$key]);
}
} else {
$text = str_replace($replaceword, ''.$replaceword.'', $text);
}更多相關內容 http://www.discuz.net/thread-698141-1-1.html
如果都沒改過檔案請下載附件覆蓋即可
頁:
[1]