修复 SEO标题添加空格无效的问题。

This commit is contained in:
Mushan3420 2017-01-18 18:27:54 +08:00
parent b3ee0dd320
commit 1bc92c7e11
1 changed files with 2 additions and 2 deletions

View File

@ -47,8 +47,8 @@ class helper_seo {
public static function strreplace_strip_split($searchs, $replaces, $str) {
$searchspace = array('((\s*\-\s*)+)', '((\s*\,\s*)+)', '((\s*\|\s*)+)', '((\s*\t\s*)+)', '((\s*_\s*)+)');
$replacespace = array('-', ',', '|', ' ', '_');
$searchspace = array('(((\s)*\-(\s)*)+)', '(((\s)*\,(\s)*)+)', '(((\s)*\|(\s)*)+)', '(((\s)*\t(\s)*)+)', '(((\s)*_(\s)*)+)');
$replacespace = array('$3-$3', '$3,$3', '$3|$3', '$3 $3', '$3_$3');
return trim(preg_replace($searchspace, $replacespace, str_replace($searchs, $replaces, $str)), ' ,-|_');
}