ctgwglzc 发表于 2007-12-13 00:13:17

关于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);
}

3xh214313hfki 发表于 2011-5-13 18:56:09

页: [1]
查看完整版本: 关于tag解析出错的补丁