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

rar’s picture

Since 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.

eafarris’s picture

Assigned: Unassigned » eafarris

You are correct, db_query() runs the query through db_escape_string(), which does an addslashes(). Fixed in HEAD and DRUPAL-4.6. Thanks!

Anonymous’s picture