Report new bug | New search | Development Roadmap Status: Open | Feedback | All

Bug #14483 http_build_url incorrect || undocumented behaviuor
Submitted: 2008-08-10 23:39 UTC
From: crrodriguez at suse dot de Assigned: mike
Status: Bogus Package: Documentation (version 1.6.1)
PHP Version: 5_2 CVS-2008-08-10 (dev) OS: linux
Roadmaps: (Not assigned)    
Subscription  


 [2008-08-10 23:39 UTC] crrodriguez at suse dot de (Cristian Rodriguez)
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"

Comments

 [2008-08-12 13:32 UTC] mike at php dot net
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.
 [2009-05-03 16:59 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!