搜索
 找回密码
 加入

关于tag解析出错的补丁

ctgwglzc 2011-5-13 18:56:09 2062
适应版本:Discuz!6.0.0(0904版本)
修正问题:查看帖子的时候出现诸如

  1. php?name=%B5%C8%C0%EB%D7%D3" onclick="tagshow(event)" class="t_tag">
复制代码
的多余内容
修正方法:
1.打开viewthread.php
查找
  1. $postlist[$firstpid]['message'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$_DCACHE[tags], '\\1')", $postlist[$firstpid]['message']);
复制代码
改为
  1. $postlist[$firstpid]['message'] = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$_DCACHE[tags], '\\1')", $postlist[$firstpid]['message']);
  2. $postlist[$firstpid]['message'] = preg_replace('#(.*)#siUe', "'\\1'", $postlist[$firstpid]['message']);
复制代码
2.打开include/discuzcode.func.php
查找
  1. $message = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$highlightarray, '\\1', 0)", $message);
复制代码
改为
  1. $message = preg_replace('#(^|>)([^<]+)(?=<|$)#sUe', "highlight('\\2', \$highlightarray, '\\1', 0)", $message);
  2. $message = preg_replace('#(.*)#siU', "\\1", $message);
复制代码
查找
  1. global $_DCACHE;
  2. if($_DCACHE['tags'][$key] && @strexists($text, $replaceword)) {
  3. $text = str_replace($replaceword, ''.$replaceword.'', $text);
  4. unset($_DCACHE['tags'][$key]);
  5. }
  6. } else {
  7. $text = str_replace($replaceword, ''.$replaceword.'', $text);
  8. }
复制代码
改为
  1. global $_DCACHE;
  2. if($_DCACHE['tags'][$key] && @strexists($text, $replaceword)) {
  3. $text = str_replace($replaceword, ''.$replaceword.'', $text);
  4. unset($_DCACHE['tags'][$key]);
  5. }
  6. } else {
  7. $text = str_replace($replaceword, ''.$replaceword.'', $text);
  8. }
复制代码

2 回复

3xh214313hfki
2011-5-13 18:56:09
提示: 作者被禁止或删除 内容自动屏蔽
高级模式
游客