[imp] Bug with URLs of form <http://www.aol.com>

Jeff Tucker jeff at jltnet.com
Wed Dec 10 20:42:55 PST 2003


--On Wednesday, December 10, 2003 11:13 PM -0500 Jeff Tucker 
<jeff at jltnet.com> wrote:

>
> Back in version 1.91, you had preg_match_all('~(((^|\s)?(\w+))://....
> This works for the cases I've seen. I'm not exactly sure what you mean by
> the comment you put in the log for version 1.92. You said you don't want
> to match a link <foo> but I think you need to.
>
> Jeff
>
>

It turns out what I wrote isn't quite sufficient. If you go back to the 
1.91 regexp, then for <http://www.aol.com> $match[3] is empty (i.e. the URL 
isn't preceded by whitespace). Because of that, your test a couple lines 
later is see if $match[3] is non-empty fails and that new URL never gets 
built.

I'm going to leave this for now. I could just eliminate the non-empty test, 
but you obviously have something in mind you're trying to do. There's 
obviously some times when you don't want to generate links for URLs but I 
don't understand when.

Jeff




More information about the imp mailing list