Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48446 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61053 invoked from network); 24 May 2010 18:58:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2010 18:58:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilia@prohost.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ilia@prohost.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain prohost.org from 209.85.212.42 cause and error) X-PHP-List-Original-Sender: ilia@prohost.org X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:36917] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/78-13219-F3CCAFB4 for ; Mon, 24 May 2010 14:58:07 -0400 Received: by vws15 with SMTP id 15so1871882vws.29 for ; Mon, 24 May 2010 11:58:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.59.74 with SMTP id k10mr2551124vch.119.1274727484645; Mon, 24 May 2010 11:58:04 -0700 (PDT) Received: by 10.220.70.148 with HTTP; Mon, 24 May 2010 11:58:04 -0700 (PDT) In-Reply-To: References: <4BF6A90D.8020901@smashlabs.com> Date: Mon, 24 May 2010 14:58:04 -0400 Message-ID: To: Kalle Sommer Nielsen Cc: Ralph Schindler , internals Content-Type: multipart/alternative; boundary=0023543a2a80e8609304875b9e7f Subject: Re: [PHP-DEV] Fixes for parse_url, bug 50563 From: ilia@prohost.org (Ilia Alshanetsky) --0023543a2a80e8609304875b9e7f Content-Type: text/plain; charset=ISO-8859-1 I think Kalle's patch is a really good solution for the trunk. +1 On Mon, May 24, 2010 at 8:51 AM, Kalle Sommer Nielsen wrote: > Hey Ralph > > 2010/5/21 Ralph Schindler : > > > > Hey all, > > > > The first patch is against trunk. I think we should at least get this > done > > even if the group decides that down the line we want the why portion > > explained as well (I actually don't care about the why part). That > feature > > would require that php_url_parse_ex() add some parsing intellignce, this > > would not be a 1 or 2 line feature implementation. > > I did a quick and dirty patch to turn the $component into a bitfield > allowing you to do: > $url = parse_url('http://www.php.net/manual/', PHP_URL_HOST | > PHP_URL_PATH); > printf('%s%s', $url['host'], $url['path']); > > At the same point I figured we could disable the warning and therefore > I added a new constant named PHP_URL_SILENT: > $broken_url = 'http:///www.php.net/'; > var_dump(parse_url($broken_url), parse_url($broken_url, PHP_URL_SILENT)); > > It doesn't alter the actual URL parser code to tell why the parsing > failed, but it kills two flies in one hit. Ofcourse the silent option > can be skipped, but while atleast updating parse_url(). > > Patch available at, this is a rough patch and does not fix the broken > tests: > http://pastie.org/974449 > > Theres a minor BC break, since it changes the values of the constants, > but it can be fixed by changing the checking code, or the dirty way to > increase the values so they don't conflict with the old ones. > > -- > regards, > > Kalle Sommer Nielsen > kalle@php.net > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --0023543a2a80e8609304875b9e7f--