Closed (fixed)
Project:
Freelinking
Version:
master
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 May 2005 at 04:35 UTC
Updated:
24 May 2005 at 22:58 UTC
1) Create a title with a single quote in it e.g. "Bob's story"
2) Create a link to it as [[Bob's story]]
3) The link seems to be created ok, but when you click on it you get the "create content" page indicating that freelinking didn't find the title.
Comments
Comment #1
rar commentedSince it seems like Drupal adds slashes already with db_query()
Perhaps line 170 instead of
$title = addslashes(urldecode($thetitle));
should be
$title = stripslashes(urldecode($thetitle));
or just
$title = urldecode($thetitle)
As it is, the query passed in is "SELECT nid from node where title = 'Bob\\\'s story"
Changing that line to either of the two above worked fine with single quotes. I have not tested with other potential strings needing addslashing.
Comment #2
eafarris commentedYou are correct, db_query() runs the query through db_escape_string(), which does an addslashes(). Fixed in HEAD and DRUPAL-4.6. Thanks!
Comment #3
(not verified) commented