From 2f51ebc8ce6b76864e52b52bd59cbd9186635ddb Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Sat, 29 Aug 2009 16:17:43 +0000 Subject: [PATCH] csplitter fixed multibytes bug --- web/Obj/brisk.phh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 6cb7f29..f52cfb3 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -290,19 +290,20 @@ function csplitter($in, $sep) $out = array(); $out[$id] = ""; for ($i = 0 ; $i < strlen($in) ; $i++) { + $ini = substr($in, $i, 1); if ($st == 0) { - if ($in{$i} == '\\') + if ($ini == '\\') $st = 1; - else if ($in{$i} == $sep) { + else if ($ini == $sep) { $id++; $out[$id] = ""; } else { - $out[$id] .= $in{$i}; + $out[$id] .= $ini; } } else if ($st == 1) { - $out[$id] .= $in{$i}; + $out[$id] .= $ini; $st = 0; } } @@ -310,7 +311,6 @@ function csplitter($in, $sep) return ($out); } - function xcape($s) { $from = array ( '\\', '@', '|' ); -- 2.17.1