addslashes() on messages from users before inserting into db.
This commit is contained in:
@@ -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']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user