Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48432 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92021 invoked from network); 24 May 2010 12:52:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 May 2010 12:52:06 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.214.42 mail-bw0-f42.google.com Received: from [209.85.214.42] ([209.85.214.42:53344] helo=mail-bw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9F/57-33110-D667AFB4 for ; Mon, 24 May 2010 08:52:05 -0400 Received: by bwz5 with SMTP id 5so452914bwz.29 for ; Mon, 24 May 2010 05:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=EK8H14WxLoxLHTOack734sZ+HOKb3aRKUj8FjFTsU6w=; b=WKAKwt5J3CB8+ZumsX0GLiOBLUOi4/i62AH9ZO1eJcDCRSZxnBKuQLOmtMKMy/ZUwM +j25oAfqEzOqYm1ubtBGUDS0Detta8JkI7t/MxlW8+o4Rl9X9trQ7Dnc3yg3OfipmxE8 iLg/Ri1d7+F08+4qtbGAJiAZ0cpb4UI67PXeU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=qpW+g6gIV2E3QB+U5e8v6833oaYMfH3Ym7j5g7XTID1EEBWSRlPD6rbpjXSJvDsOvS MFCCjFQkx3sHnVjbrfdchhNRHGbIabbX8gBMuS7eVV9UBTMxZlVN5fo+CTeoTYu8WUkF VKJ1ROGKEzFMbC/ACDwthQGgHPxDNQpzpX4Ks= MIME-Version: 1.0 Received: by 10.204.27.14 with SMTP id g14mr2146001bkc.36.1274705509025; Mon, 24 May 2010 05:51:49 -0700 (PDT) Sender: kalle.php@gmail.com Received: by 10.204.60.206 with HTTP; Mon, 24 May 2010 05:51:48 -0700 (PDT) In-Reply-To: <4BF6A90D.8020901@smashlabs.com> References: <4BF6A90D.8020901@smashlabs.com> Date: Mon, 24 May 2010 14:51:48 +0200 X-Google-Sender-Auth: b8glZyxid-IDNG5CunrSRyxPeqc Message-ID: To: Ralph Schindler Cc: internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Fixes for parse_url, bug 50563 From: kalle@php.net (Kalle Sommer Nielsen) Hey Ralph 2010/5/21 Ralph Schindler : > > Hey all, > > The first patch is against trunk. =A0I 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 featur= e > 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 =3D parse_url('http://www.php.net/manual/', PHP_URL_HOST | PHP_URL_PAT= H); 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 =3D '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. --=20 regards, Kalle Sommer Nielsen kalle@php.net