]> git.mxchange.org Git - friendica.git/commitdiff
parsing multi-byte strings with xmlify
authorZach Prezkuta <fermion@gmx.com>
Wed, 6 Feb 2013 07:37:15 +0000 (00:37 -0700)
committerZach Prezkuta <fermion@gmx.com>
Wed, 6 Feb 2013 07:37:15 +0000 (00:37 -0700)
include/text.php

index 03ff32cff9de4c3667dea105e1085d70c98a852d..075d345cb2d21938d40a687992542c253dd2d045 100644 (file)
@@ -175,8 +175,9 @@ if(! function_exists('xmlify')) {
 function xmlify($str) {
        $buffer = '';
        
-       $str_array = preg_split('//u', $str, -1, PREG_SPLIT_NO_EMPTY);
-       foreach($str_array as $char) {
+       $len = mb_strlen($str);
+       for($x = 0; $x < $len; $x ++) {
+               $char = mb_substr($str,$x,1);
         
                switch( $char ) {