[dev] Re: [imp] bug converting some mailto's to URL's
Jan Schneider
jan at horde.org
Thu Mar 13 21:44:18 PST 2003
Quoting Chuck Hagenbuch <chuck at horde.org>:
> Quoting Jeff Tucker <jeff at jltnet.com>:
>
> > I have imp-CVS as of a couple weeks ago. I have the latest version of
> > horde/lib/Text.php according to the online CVS browser at horde.org.
> >
> > I've found that a mailto of the form mailto:jefft at f123.com appears on
> my
> > system as a link to email "jefft at f". And it stops there.
>
> I'm moving this to the dev list for now. I can't quite parse the regexp
> to
> figure out why, but it's trying to split out things like
> mailto:foo at bar.com?subject=foo. Which does work, but with jefft at f123.com,
> 123.com gets put where subject=foo ought to go.
>
> I've moved the code into its own function in Text.php, and put in some
> code
> that should make it easier to figure out what's going on (you have to set
> a
> variable, and then it'll dump the regexp matches for you. If a regexp
> person
> could have a look at this and figure out why it's getting 123.com into
> match
> 6, instead of match 4, without breaking the ?subject functionality,
> that'd
> be great.
I tracked it down to a change Michael made to catch the square brackets []
that some mail clients add around mail addresses.
He put something in like (I don't have the code here right now): (?(1))
This obviously is wrong and catches the "1" from 123.com.
Another thing that I'm not sure about: As the regex is in single quotes,
shouldn't all backslashes being escaped so that they appear as single
backslashes in the actual regex?
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
More information about the dev
mailing list