Menu

#2 Trap event with quote not INSERTed in database

open
nobody
None
5
2007-03-02
2007-03-02
Fabrice
No

trapd.pl, version: 4.1.8

A trap whose event text contains a quote (') character
is not inserted in the database.

In trapd.pl, line 487: the INSERT SQL command will
fail because the quote is not escaped in the event
field.

The solution is to add the line:
$event =~ s/\'/\\\'/g; ## replace ' with \'

before the creation of the INSERT command string.

Discussion


Log in to post a comment.