Req #50563 [Com]: removing E_WARNING from parse_url()
| From: | dan at teton dot com | Date: | Mon, 07 Feb 2011 21:00:14 +0000 |
| Subject: | Req #50563 [Com]: removing E_WARNING from parse_url() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158566@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=50563&edit=1
ID: 50563
Comment by: dan at teton dot com
Reported by: philip@php.net
Summary: removing E_WARNING from parse_url()
Status: Open
Type: Feature/Change Request
Package: *General Issues
Operating System: N/A
PHP Version: 5.3.2RC1
Block user comment: N
Private report: N
New Comment:
This is STILL throwing E_WARNING. Not good.
Previous Comments:
------------------------------------------------------------------------
[2010-06-16 20:56:26] pajoye@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=300501
Log: - #50563, removing E_WARNING from parse_url()
------------------------------------------------------------------------
[2010-05-24 16:30:57] philip@php.net
I don't think the bit fields should be used to hide the warning.
------------------------------------------------------------------------
[2010-05-24 15:38:58] kalle@php.net
The following patch has been added/updated:
Patch Name: parse-url-bitfields
Revision: 1274708338
URL:
http://bugs.php.net/patch-display.php?bug=50563&patch=parse-url-bitfields&revision=1274708338
------------------------------------------------------------------------
[2010-05-24 15:36:44] pajoye@php.net
Derick, I don't see why you would change the return value here. Please
explain your reasoning.
However the patch to remove the warning can be applied already, as I
explained on internals.
------------------------------------------------------------------------
[2010-05-24 15:18:53] kalle@php.net
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().
The patch uploaded here does not currently fix any broken tests.
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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=50563
--
Edit this bug report at http://bugs.php.net/bug.php?id=50563&edit=1