Doc #64846 [ReO->Csd]: Documentation says parse_url doesn't work with relative urls but it does

From: Date: Mon, 29 May 2017 14:05:56 +0000
Subject: Doc #64846 [ReO->Csd]: Documentation says parse_url doesn't work with relative urls but it does
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14746@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=64846&edit=1 ID: 64846 Updated by: requinix@php.net Reported by: alias dot mac at gmail dot com Summary: Documentation says parse_url doesn't work with relative urls but it does -Status: Re-Opened +Status: Closed Type: Documentation Problem Package: *URL Functions PHP Version: 5.3.25 -Assigned To: +Assigned To: peehaa Block user comment: N Private report: N New Comment: Sounds like there was a good reason, then. So in practice relative URLs tend to work but some forms will be able to fool the parser. Previous Comments: ------------------------------------------------------------------------ [2017-05-29 13:30:47] peehaa@php.net http://news.php.net/php.doc.cvs/11573 ------------------------------------------------------------------------ [2017-05-29 13:22:13] peehaa@php.net I did make the change in 2013 https://svn.php.net/viewvc?view=revision&revision=331013. But people started shouting at me that it was *not* officially supported and my change was wrong. Hence I reverted. So ¯\_(ツ)_/¯, if somebody else wants to make this change and/or close this bug report feel free to go for it :-) ------------------------------------------------------------------------ [2017-05-28 19:27:53] osmanov@php.net The note is still there. ------------------------------------------------------------------------ [2013-07-24 10:29:01] peehaa@php.net This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. ------------------------------------------------------------------------ [2013-05-15 18:42:29] alias dot mac at gmail dot com Description: ------------ --- From manual page: http://www.php.net/function.parse-url#refsect1-function.parse- url-notes --- It has on the notes: "This function doesn't work with relative URLs." But with my test script looks like it is working just fine: $ php --version PHP 5.3.20 (cli) (built: Jan 21 2013 15:03:13) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans Test script: --------------- <?php $x = 'http://example.com/path/to/somewhere?param1=x&param2=http://another.example.com/path/to/another/example/'; var_dump(parse_url($x)); $y = 'path/to/somewhere?param1=x&param2=http://another.example.com/path/to/another/example/'; var_dump(parse_url($y)); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=64846&edit=1

« previous php.doc.bugs (#14746) next »