On November 27, 2002 04:32 pm, Sterling Hughes wrote:
> > On November 27, 2002 04:45 pm, Sara "Pollita" Golemon wrote:
> > > That was one of the comments I was looking for "Is this really
> > > necessary?" After all the user can certainly use explode() to take it
> > > apart.  I'm not against giving him that answer, it was just a quick
> > > patch to write...
> > >
> > > Is that a -1 then?
> >
> > Yup, -1 from me.
>
> I disagree with this, the current behaviour is imho wrong.
>
> mailto: is a url, rejecting the patch because it introduces a special case,
> is not a good thing.  parse_url() is for _all_ url's, not just http://
> url's, and besides, the current syntax for mailto is completely valid, and
> should be parsed anyway.
>
> (ie, a special case shouldn't be required if the url parser was rfc
> compliant).

PHP's php_url_parse() function is not in any way limited to http:// as you 
claim, it support a large variety of valid URLs, take a look at the very 
extensive test for parse_url() function located here: 
ext/standard/tests/strings/url_t.phpt.
Even the regular expression described in RFC 2396 does not recognize 
mailto: any differently the our very own parse_url().

Ilia

> -Sterling
>
> > > > I am not so sure that adding special cases for things like mailto:
> > > > and so on  is a good idea. The code works identically to how it
> > > > worked in 4.2.3 and  prior.
> > > >
> > > > Ilia
> > > >
> > > > On November 27, 2002 04:19 pm, Sara "Pollita" Golemon wrote:
> > > >> While waiting for opinions on Bug#20460 I went ahead and addressed
> > > >> #20308.
> > > >>
> > > >> User complains that parse_url returns the full email address in
> > > >> 'path' element.  Makes reference to documents which claim it should
> > > >> return 'user' and 'host' element.
> > > >>
> > > >> To address this request and maintain backward compatability I wrote
> > > >> a patch to split the 'path' element in to 'host' and 'user' elements
> > > >> then return all three.
> > > >>
> > > >> Ex:
> > > >> *current behavior*
> > > >> print_r(parse_url("mailto:[EMAIL PROTECTED]";));
> > > >> Array (
> > > >>   [scheme] => mailto
> > > >>   [path] => [EMAIL PROTECTED]
> > > >> }
> > > >>
> > > >> *new behavior*
> > > >> print_r(parse_url("mailto:[EMAIL PROTECTED]";));
> > > >> Array (
> > > >>   [scheme] => mailto
> > > >>   [path] => [EMAIL PROTECTED]
> > > >>   [user] => pollita
> > > >>   [host] => php.net
> > > >> }
> > > >>
> > > >> If there are no objections I'll commit this change.
> >
> > --
> > PHP Development Mailing List <http://www.php.net/>
> > To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to