From: defacer Date: Thu, 9 Sep 2004 10:58:25 +0000 (+0000) Subject: Merging addslashes() change from stable. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=811366147139876a6c945bcebe05a3403394fe1e;p=moodle.git Merging addslashes() change from stable. --- diff --git a/mod/chat/chatd.php b/mod/chat/chatd.php index 5d9f8a92d2..f940efe49a 100755 --- a/mod/chat/chatd.php +++ b/mod/chat/chatd.php @@ -408,9 +408,16 @@ class ChatDaemon { break; } + // A slight hack to prevent malformed SQL inserts + $origmsg = $msg->message; + $msg->message = addslashes($msg->message); + // Commit to DB insert_record('chat_messages', $msg); + // Undo the hack + $msg->message = $origmsg; + // OK, now push it out to all users $this->message_broadcast($msg, $this->sets_info[$sessionid]['user']);