[PEAR-BUG] Bug #14483 [Asn->Bgs]: http_build_url incorrect || undocumented behaviuor

[email protected]
Newsgroups php.pear.doc
Message-ID <[email protected]>
Edit report at http://pear.php.net/bugs/bug.php?id=14483&edit=1

 ID:               14483
 Updated by:       [email protected]
 Reported By:      crrodriguez at suse dot de
 Summary:          http_build_url incorrect || undocumented behaviuor
-Status:           Assigned
+Status:           Bogus
 Type:             Bug
 Package:          Documentation
 Operating System: linux
 Package Version:  1.6.1
 PHP Version:      5_2 CVS-2008-08-10 (dev)
 Assigned To:      mike
 Roadmap Versions: 
 New Comment:

-Status: Assigned
+Status: Bogus

that's a php documentation issue, not a PEAR one.


Previous Comments:
------------------------------------------------------------------------

[2008-08-12 09:32:42] 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.

------------------------------------------------------------------------

[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://pear.php.net/bugs/bug.php?id=14483&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.