diff options
author | Derek Jones <derek.jones@ellislab.com> | 2008-10-11 00:37:06 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2008-10-11 00:37:06 +0200 |
commit | fd275707f6c1a5a63feb8708731d7c97683df765 (patch) | |
tree | 606a03c3241b930303a8c257043c9cd802e6aa71 /system | |
parent | ccfe9139d574f37163c81d8c7d2c73d6a53d3ab1 (diff) |
modifications to url_title()
Diffstat (limited to 'system')
-rw-r--r-- | system/helpers/url_helper.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index acf889007..002090df1 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -479,19 +479,20 @@ if ( ! function_exists('url_title')) }
$trans = array(
- $search => $replace,
- "\s+" => $replace,
- "[^a-z0-9".$replace."]" => '',
- $replace."+" => $replace,
- $replace."$" => '',
- "^".$replace => ''
- );
+ '&\#\d+?;' => '',
+ '&\S+?;' => '',
+ '\s+' => $replace,
+ '[^a-z0-9\-\._]' => '',
+ $replace.'+' => $replace,
+ $replace.'$' => $replace,
+ '^'.$replace => $replace
+ );
- $str = strip_tags(strtolower($str));
+ $str = strip_tags($str);
foreach ($trans as $key => $val)
{
- $str = preg_replace("#".$key."#", $val, $str);
+ $str = preg_replace("#".$key."#i", $val, $str);
}
return trim(stripslashes($str));
|