From fd275707f6c1a5a63feb8708731d7c97683df765 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 10 Oct 2008 22:37:06 +0000 Subject: modifications to url_title() --- system/helpers/url_helper.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'system') 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)); -- cgit v1.2.3-24-g4f1b