Explorar el Código

[php] fix StringTools.replace() for unicode

Alexander Kuzmenko hace 7 años
padre
commit
5c952dd550
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      std/php/_std/StringTools.hx

+ 1 - 1
std/php/_std/StringTools.hx

@@ -83,7 +83,7 @@ import php.*;
 
 	public static function replace( s : String, sub : String, by : String ) : String {
 		if (sub == '') {
-			return Global.implode(by, Global.str_split(s));
+			return Global.implode(by, Global.preg_split('//u', s, -1, Const.PREG_SPLIT_NO_EMPTY));
 		}
 		return Global.str_replace(sub, by, s);
 	}