CodeIgniter Forums
text_helper bug - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: text_helper bug (/showthread.php?tid=2707)



text_helper bug - El Forum - 08-20-2007

[eluser]Référencement Google[/eluser]
Hi,

Found a bug in the text_helper, function character_limiter. While returning latin characters, like à I didn't understood why but depending on the string limited lenght, it sometimes return a wrong encoded string (appears some ? in string)

So, changing this line solves the problem:

ORIGINAL
Code:
$str = preg_replace("/\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", ' ', $str));

MODIFIED
Code:
$str = preg_replace("/S+\s+/", ' ', preg_replace("/(\r\n|\r|\n)/", ' ', $str));