Welcome Guest, Not a member yet? Register   Sign In
auto_link with 2 urls from the same domain
#14

[eluser]sophistry[/eluser]
while we are at it... i believe that i just found another bug in the original auto_link code...

run this little bugger through auto_link() as it is now: [email protected]

something strange happens. i see a bunch of javascript code that looks sorta like this (i say "sorta like" because i can't be sure what the forum is going to do to all this javascript):
Code:
//= 0; i=i-1){ if (l[i].substring(0, 1) == '|') [removed]("&#"+unescape(l[i].substring(1))+";"); else [removed](unescape(l[i]));} //]]> ">http://[email protected]

do you see that too? the problem is that way that the current CI SVN 1.7.1 auto_link() code handles the www. at the beginning of a string. it assumes that if there is a "www." then it is a URL and converts it, then the email auto_link() goes to town on that converted string and bing,bam,boom javascript is spilling onto the page.

this string is both a valid email and a valid URL. URLs can have a http://user:[email protected] format - it's insecure login style, but a perfectly valid and useful URL nonetheless. the problem comes because the auto_link() code prioritizes parsing URLs over emails - URLs go first. then, the email regex has its chance and it is not selective enough and it decides it has found (now) two email addresses and writes them out in javascript.

yikes.

as it stands now, my current code submission only deals with the URL parsing side of things... would you like me to have a stab at fixing the email too?


Messages In This Thread
auto_link with 2 urls from the same domain - by El Forum - 10-29-2008, 08:15 PM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 07:25 AM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 07:43 AM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 07:48 AM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 08:43 AM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 08:55 AM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 11:15 AM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 01:14 PM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 01:23 PM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 07:42 PM
auto_link with 2 urls from the same domain - by El Forum - 10-30-2008, 07:56 PM
auto_link with 2 urls from the same domain - by El Forum - 11-01-2008, 11:28 AM
auto_link with 2 urls from the same domain - by El Forum - 11-02-2008, 04:04 PM
auto_link with 2 urls from the same domain - by El Forum - 11-02-2008, 07:36 PM
auto_link with 2 urls from the same domain - by El Forum - 11-02-2008, 07:57 PM
auto_link with 2 urls from the same domain - by El Forum - 11-03-2008, 08:57 AM
auto_link with 2 urls from the same domain - by El Forum - 11-03-2008, 02:48 PM
auto_link with 2 urls from the same domain - by El Forum - 11-06-2008, 10:03 AM
auto_link with 2 urls from the same domain - by El Forum - 07-13-2009, 11:13 AM
auto_link with 2 urls from the same domain - by El Forum - 07-13-2009, 11:36 AM
auto_link with 2 urls from the same domain - by El Forum - 07-13-2009, 11:46 AM
auto_link with 2 urls from the same domain - by El Forum - 07-13-2009, 08:12 PM
auto_link with 2 urls from the same domain - by El Forum - 07-15-2009, 10:44 AM
auto_link with 2 urls from the same domain - by El Forum - 07-15-2009, 05:45 PM
auto_link with 2 urls from the same domain - by El Forum - 07-15-2009, 06:42 PM
auto_link with 2 urls from the same domain - by El Forum - 07-17-2009, 10:30 PM
auto_link with 2 urls from the same domain - by El Forum - 07-18-2009, 12:20 AM
auto_link with 2 urls from the same domain - by El Forum - 07-18-2009, 10:15 AM
auto_link with 2 urls from the same domain - by El Forum - 07-27-2009, 01:24 PM
auto_link with 2 urls from the same domain - by El Forum - 08-01-2009, 04:30 PM
auto_link with 2 urls from the same domain - by El Forum - 08-23-2009, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB