|
    
- 帖子
- 6628
- 积分
- 7679
- 威望
- 159
- 金币
- 498 个
- 体力
- 5930
- 注册时间
- 2005-10-20
|

关于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[tags], '\\1')", $postlist[$firstpid]['message']);
复制代码 改为- $postlist[$firstpid]['message'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$_DCACHE[tags], '\\1')", $postlist[$firstpid]['message']);
- $postlist[$firstpid]['message'] = preg_replace('#<highlight>(.*)</highlight>#siUe', "'<span href=\"tag.php?name='.rawurlencode('\\1').'\" onclick=\"tagshow(event)\" class=\"t_tag\">\\1</span>'", $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('#<highlight>(.*)</highlight>#siU', "<strong><font color=\"#FF0000\">\\1</font></strong>", $message);
复制代码 查找- global $_DCACHE;
- if($_DCACHE['tags'][$key] && @strexists($text, $replaceword)) {
- $text = str_replace($replaceword, '<span href="tag.php?name='.rawurlencode($replaceword).'" onclick="tagshow(event)" class="t_tag">'.$replaceword.'</span>', $text);
- unset($_DCACHE['tags'][$key]);
- }
- } else {
- $text = str_replace($replaceword, '<strong><font color="#FF0000">'.$replaceword.'</font></strong>', $text);
- }
复制代码 改为- global $_DCACHE;
- if($_DCACHE['tags'][$key] && @strexists($text, $replaceword)) {
- $text = str_replace($replaceword, '<highlight>'.$replaceword.'</highlight>', $text);
- unset($_DCACHE['tags'][$key]);
- }
- } else {
- $text = str_replace($replaceword, '<highlight>'.$replaceword.'</highlight>', $text);
- }
复制代码 如若未对文件进行过修改,可以直接下载附件里的程序进行覆盖同名文件即可
[ 本帖最后由 lu5266 于 2007-10-19 10:54 编辑 ] |
-
-
tag.zip (12.82 KB)
-
1
评分次数
-
|