summaryrefslogtreecommitdiffstats
path: root/system/helpers/url_helper.php
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-10-11 00:37:06 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-10-11 00:37:06 +0200
commitfd275707f6c1a5a63feb8708731d7c97683df765 (patch)
tree606a03c3241b930303a8c257043c9cd802e6aa71 /system/helpers/url_helper.php
parentccfe9139d574f37163c81d8c7d2c73d6a53d3ab1 (diff)
modifications to url_title()
Diffstat (limited to 'system/helpers/url_helper.php')
-rw-r--r--system/helpers/url_helper.php19
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));