From 3bdf570693a9c6be8e3bff5d62b21dae18817f27 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Wed, 17 Jan 2007 08:52:14 +0000 Subject: [PATCH] corretta gestione stringhe --- web/brisk.phh | 5 ++++- web/index.php | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) 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"; -- 2.17.1