Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

2.0标题里短横线前后不支持横线的BUG,建议2.5修正下,帖子里有修改方法。

[复制链接]
按下快乐键 发表于 2011-12-17 23:46:13 | 显示全部楼层 |阅读模式
-
在后台SEO设置里,在" - "的前后都添加了空格




保存设置以后 在浏览器标题上显出不出空格:






SEO设置不支持空格解决方案:

修改文件:source/function/function_core.php 2506 行附近         修改之前请备份好原文件~!

查找:
  1. function strreplace_strip_split($searchs, $replaces, $str) {

  2. $searchspace = array('((\s*\-\s*)+)', '((\s*\,\s*)+)', '((\s*\|\s*)+)', '((\s*\t\s*)+)', '((\s*_\s*)+)');

  3. $replacespace = array('-', ',', '|', ' ', '_');

  4. return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_');

  5. }
复制代码
替换为:
  1. function strreplace_strip_split($searchs, $replaces, $str) {

  2. $searchspace = array('(((\s)*\-(\s)*)+)', '((\s*\,\s*)+)', '((\s*\|\s*)+)', '((\s*\t\s*)+)', '((\s*_\s*)+)');

  3. $replacespace = array('$3-$3', ',', '|', ' ', '_');

  4. return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_');

  5. }
复制代码
后台更新缓存!

这样就可以解决了,但是得修改源码,以后升级很不方便,建议2.5能修正过来。


回复

使用道具 举报

 楼主| 按下快乐键 发表于 2011-12-18 18:49:15 | 显示全部楼层
期待官方能修正!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-8-27 20:54 , Processed in 0.136761 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表