From: Matteo Nastasi (mop) Date: Mon, 12 Nov 2012 17:15:39 +0000 (+0100) Subject: explicit mb_substr to dimension usernames and chat lines X-Git-Tag: v4.0.1~5 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=0fd9bab2d4822c3682dd213e4028789fb8707401;p=brisk.git explicit mb_substr to dimension usernames and chat lines --- diff --git a/web/Obj/brisk.phh b/web/Obj/brisk.phh index 0c94fce..586f0d9 100644 --- a/web/Obj/brisk.phh +++ b/web/Obj/brisk.phh @@ -1219,7 +1219,7 @@ class Room { $only_you = FALSE; // common settings - $msg = substr($mesg, 6, 128); + $msg = mb_substr($mesg, 6, 128, "UTF-8"); $curtime = time(); $dt = date("H:i ", $curtime); $target = ""; @@ -2677,7 +2677,7 @@ function validate_sess($sess) function validate_name($name) { - $name_new = str_replace(' ', '_', substr(trim($name),0,12)); + $name_new = str_replace(' ', '_', mb_substr(trim($name),0,12, "UTF-8")); for ($i = 0 ; $i < strlen($name_new) ; $i++) { $c = $name_new[$i];