From 18f71c1050f3333e88b69e0ef18d9bdef3e09190 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Wed, 6 Feb 2013 00:37:15 -0700 Subject: [PATCH] parsing multi-byte strings with xmlify --- include/text.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/text.php b/include/text.php index 03ff32cff9..075d345cb2 100644 --- a/include/text.php +++ b/include/text.php @@ -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 ) {