Hi,
I have a problem with sql injections in my postgresql database;
Here is the request which works most of the time :
INSERT INTO tdb (tweet, author, date, url, tags) VALUES ('{{{msg.txttweet}}}','{{msg.tweet.user.screen_name}}','{{msg.tweet.created_at}}','https://twitter.com/{{msg.tweet.user.screen_name}}/status/{{msg.tweet.id_str}}','{{msg.hst}}')
I use the {{{}}} to avoid html transformation but sometimes when I have some characters in the tweet ( a string) I have this kind of error message :
The tweet :
RT @ajaltamimi: New post on publication that appeared not too long ago documenting lives of various male & female 'martyrs' of I…
The error message :
msg : error "error: syntax error at or near "martyrs""
It seems that the ' character is the problem, and futhermore I don't know why the & is replace by & despite the use of {{{}}}
Have you tried using the Parameterized query syntax instead of the Template ?
From what i read in this article it sanitizes the input .. I havent tested it though
Or you should be able to escape the 'martyrs' like this, 'RT @ajaltamimi: New post on publication that appeared not too long ago documenting lives of various male & female ''martyrs'' of I...'
So prior to the template add a change node set to
change msg.txttweet
search for '
repolace with ''