PDA

View Full Version : Problem with URL's with an & in them?


sornman
04-25-2008, 01:57 PM
Using RC4, and when putting a URL with an & in it, it is breaking.


http://www.someurl.com/page.php?item=blah&item2=blah2


When you insert that link, it converts the &'s to & then it tries to convert it to a linkable URL, causing the link to be:


<a href="http://www.someurl.com/page.php?item=blah&amp">http://www.someurl.com/page.php?item=blah&amp</a>;item2=blah2


When searching for a solution to this issue, I came across an issue that was supposedly fixed in RC3 that could be relevant. The above URL was on a line by itself, so the fix that was implemented may be causing this new issue. Issue I mentioned is:

http://osticket.com/forums/project.php?issueid=18

apfel24
12-17-2008, 09:44 AM
in ../include/class.format.php on line 81

replace
$text=eregi_replace('(((f|ht){1}tp(s?)://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)','<a href="\\1" target="_blank">\\1</a>', $text);

with
$text=eregi_replace('(((f|ht){1}tp(s?)://)[-a-zA-Z0-9@:%_\+.~#?&amp;//=]+)','<a href="\\1" target="_blank">\\1</a>', $text);