修复 SEO标题添加空格无效的问题。
This commit is contained in:
parent
b3ee0dd320
commit
1bc92c7e11
|
@ -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)), ' ,-|_');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue