From: Matteo Nastasi (mop) Date: Wed, 17 Jan 2007 08:52:14 +0000 (+0000) Subject: corretta gestione stringhe X-Git-Tag: 3.0.0~366 X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=3bdf570693a9c6be8e3bff5d62b21dae18817f27;p=brisk.git corretta gestione stringhe --- diff --git a/web/brisk.phh b/web/brisk.phh index 03ec212..df4c3f1 100644 --- a/web/brisk.phh +++ b/web/brisk.phh @@ -36,7 +36,10 @@ define(BRISK_DEBUG, FALSE); function xcape($s) { - return (str_replace('\\', '\\\\', str_replace('@', '@', str_replace('|', '¦', htmlentities($s,ENT_COMPAT,"UTF-8"))))); + $from = array ( '\\', '@', '|' ); + $to = array ( '\\\\', '@', '¦' ); + + return (str_replace($from, $to, htmlentities($s,ENT_COMPAT,"UTF-8"))); } diff --git a/web/index.php b/web/index.php index 100547f..b5d96ed 100644 --- a/web/index.php +++ b/web/index.php @@ -58,6 +58,7 @@ function main() $bri->garbage_manager(TRUE); /* try login */ $name = substr($name, 0, 12); + $name = str_replace(" ", "_", $name); if (($user = &$bri->add_user(&$sess, &$idx, $name)) != FALSE) { $ACTION = "room";