For freelinks with brackets like [[My node]], URL is encoded twice, and the link becomes "?q=freelinking/My%2520node".

I changed in freelinking.module, in function _freelinking_do_filtering the line 257 :

$replacement = l($phrase, 'freelinking/' . rawurlencode(htmlspecialchars(rawurlencode(($freelink))));

In :

$replacement = l($phrase, 'freelinking/' . rawurlencode(htmlspecialchars($freelink)));

It works fine now, but can you tell me if this minor change is correct or give me the right way to fix it ?

Thanks.

PS : this module was useful for me. Thanks for your work !

Comments

krypton1’s picture

I was having this exact same problem. Basically all my freelinks had a 2520 in there instead of just a 20 and it def. looked like it was getting urlencoded twice. I made the fix you suggested, but when I tested it, it was still using the wrong link with the %2520. Deleted all the database entries for freelinking, hit edit->submit on the story I was testing to get the filters run again. Still was having the same problem. Finally, after about 6 hours of head banging on the computer, I tried disabling the SmartyPants module and it seemed to start working. More specifically, I just made the SmartyPants filter run AFTER the freelinking filter (go to administer -> input formats -> configure -> rearrange).

What is bizarre is that now I can't for the life of me duplicate the old error I was getting. In other words, I tried putting the smartypants module BACk to running before freelinking, deleted all freelinks database entries, hit edit submit on the story I was testing, and it still had the CORRECT working links. Maybe there is some part of how the whole thing works that I'm still not understanding, or I'm losing my mind....but I still figured I'd post this in case anyone else is having the same problem. Try disabling the smartypants module or setting it to filter AFTER the freelinks filter on the input formats page. And try deleting the database entries and resubmitting the story you are working on to get the filters run again.

Man this has been a frustrating bug!!

eafarris’s picture

Assigned: Unassigned » eafarris
Status: Active » Fixed

Committed a fix to HEAD. Seems to work in my testing. Please verify & close.

Anonymous’s picture

Status: Fixed » Closed (fixed)
thomasvandierendonck’s picture

Status: Closed (fixed) » Needs review

Is it possible this bug is back? I'm using version 6.3 alpha 2 and have the exact problems that are described here.

misc’s picture

Old issue, and I have no possibility to check for D6 right now, is this bug resolved?

gisle’s picture

Version: master » 6.x-3.3
Issue summary: View changes
Status: Needs review » Closed (cannot reproduce)

Tested this with version 7.x-3.3 and 6.x-3.3 and was unable to reproduce.

Tested both with and without clean URLs enabled.

Please feel free to reopen if you think this is still unresolved. In that case, please include instructions about how to reproduce from a clean install.