]> git.mxchange.org Git - friendica.git/commitdiff
better unicode support in xmlify
authorZach Prezkuta <fermion@gmx.com>
Wed, 6 Feb 2013 06:02:13 +0000 (23:02 -0700)
committerZach Prezkuta <fermion@gmx.com>
Wed, 6 Feb 2013 06:02:13 +0000 (23:02 -0700)
include/text.php

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