diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-01-08 06:06:35 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-01-08 06:06:35 +0100 |
commit | cb324bd9268fc6b0c93fd22545bd989771d68b04 (patch) | |
tree | c1d37b3f9af6531ee2da5e1c372cbb862cbee82f /system/helpers/text_helper.php | |
parent | fc443553248af8ac0c1cbb635fe9cbb70fdf7b82 (diff) |
Some more misc. stuff
Diffstat (limited to 'system/helpers/text_helper.php')
-rw-r--r-- | system/helpers/text_helper.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 3a847f29b..cef32847d 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter Text Helpers * @@ -93,7 +91,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_replace(array("\r\n", "\r", "\n"), ' ', $str)); if (strlen($str) <= $n) { @@ -108,7 +106,7 @@ if ( ! function_exists('character_limiter')) if (strlen($out) >= $n) { $out = trim($out); - return (strlen($out) == strlen($str)) ? $out : $out.$end_char; + return (strlen($out) === strlen($str)) ? $out : $out.$end_char; } } } @@ -354,7 +352,7 @@ if ( ! function_exists('highlight_phrase')) if ($phrase != '') { - return preg_replace('/('.preg_quote($phrase, '/').')/i', $tag_open."\\1".$tag_close, $str); + return preg_replace('/('.preg_quote($phrase, '/').')/i', $tag_open.'\\1'.$tag_close, $str); } return $str; |