summaryrefslogtreecommitdiffstats
path: root/system/helpers/text_helper.php
diff options
context:
space:
mode:
authorMelounek <petr@heralecky.cz>2012-10-05 15:50:00 +0200
committerMelounek <petr@heralecky.cz>2012-10-05 15:50:00 +0200
commitcc7c7c691ad16beb5040a8a1d07064e61b5e2167 (patch)
treef0ed98dc9f580bf38cfb13b72d8ab2cddfd69a3f /system/helpers/text_helper.php
parent58dfc089bf5b0ca35c2ff244e5bfdff726f9adcd (diff)
parent6123b61e8ec95ac91f67bfbf442e34021c922319 (diff)
update devel version
Diffstat (limited to 'system/helpers/text_helper.php')
-rw-r--r--system/helpers/text_helper.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 8a1f01b51..b592f3cc0 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -89,7 +89,8 @@ if ( ! function_exists('character_limiter'))
return $str;
}
- $str = preg_replace('/\s+/', ' ', str_replace(array("\r\n", "\r", "\n"), ' ', $str));
+ // a bit complicated, but faster than preg_replace with \s+
+ $str = preg_replace('/ {2,}/', ' ', str_replace(array("\r", "\n", "\t", "\x0B", "\x0C"), ' ', $str));
if (strlen($str) <= $n)
{