From cdbcbfc9dac126a87eaa34d411170ce198cb4ffe Mon Sep 17 00:00:00 2001 From: vlakoff Date: Fri, 31 Aug 2012 04:38:28 +0200 Subject: Simplification in Text Helper's character_limiter() Because the "\s" regex character class includes \r and \n, there is no need for the str_replace() part --- system/helpers/text_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers/text_helper.php') diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 8a1f01b51..76dc04a70 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -89,7 +89,7 @@ if ( ! function_exists('character_limiter')) return $str; } - $str = preg_replace('/\s+/', ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str)); + $str = preg_replace('/\s+/', ' ', $str); if (strlen($str) <= $n) { -- cgit v1.2.3-24-g4f1b