Bug #14483 [Opn]: http_build_url incorrect || undocumented behaviuor
| From: | mike@php.net | Date: | Tue, 12 Aug 2008 13:32:42 +0000 |
| Subject: | Bug #14483 [Opn]: http_build_url incorrect || undocumented behaviuor | ||
| References: | 1 | Groups: | php.pear.doc |
| Request: | Send a blank email to pear-doc+get-11048@lists.php.net to get a copy of this message | ||
Edit report at http://pecl.php.net/bugs/bug.php?id=14483&edit=1
ID: 14483
Updated by: mike@php.net
Reported By: crrodriguez at suse dot de
Status: Open
Id: 14483
Type: Bug
-Package: pecl_http
+Package: Documentation
Operating System: linux
PHP Version: 5_2 CVS-2008-08-10 (dev)
-Assigned To:
+Assigned To: mike
New Comment:
Sorry, actually documentation is out of date.
The default value of "flags" is HTTP_URL_REPLACE|HTTP_URL_FROM_ENV
which means, if there's no corresponding URL part in the first URL (in
your example there's no path) it's taken from the environment.
Use HTTP_URL_REPLACE as flags parameter to http_build_url and you
should get your expected result.
Previous Comments:
------------------------------------------------------------------------
[2008-08-10 19:39:22] crrodriguez at suse dot de
Description:
------------
http_build_url function documentation states
"The parts of the second URL will be merged into the first according to
the flags argument."
however, if you use the test code present in "the reproduce code"
section and place it in a directory called "foo"
Reproduce code:
---------------
<?php
var_dump(http_build_url("http://foo.com",
array('path'=>
'foobar.txt')));
?>
Expected result:
----------------
I expect the function to return
string(25) "http://foo.com/foobar.txt"
or the documentation changed stating that the current path is going to
be appended to $url (????)
Actual result:
--------------
however it returns
string(29) "http://foo.com/foo/foobar.txt"
------------------------------------------------------------------------
--
Edit this bug report at http://pecl.php.net/bugs/bug.php?id=14483&edit=1