addslashes() on messages from users before inserting into db.

This commit is contained in:
defacer
2004-09-09 10:56:57 +00:00
parent 06dc71e4e5
commit a10b3ade4d
+7
View File
@@ -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']);