cvs: pear /Net_URL URL.php
| From: | Shane Caraveo | Date: | Sat, 28 Sep 2002 23:51:58 +0000 |
| Subject: | cvs: pear /Net_URL URL.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-6736@lists.php.net to get a copy of this message | ||
shane Sat Sep 28 19:51:58 2002 EDT
Modified files:
/pear/Net_URL URL.php
Log:
fix net_url to handle unmatched query strings, such as http://nagoya.apache.org:5049/axis/services/echoA?wsdl
Index: pear/Net_URL/URL.php
diff -u pear/Net_URL/URL.php:1.15 pear/Net_URL/URL.php:1.16
--- pear/Net_URL/URL.php:1.15 Thu Sep 5 10:07:42 2002
+++ pear/Net_URL/URL.php Sat Sep 28 19:51:58 2002
@@ -121,7 +121,7 @@
$this->host = !empty($host) ? $host :
(isset($HTTP_SERVER_VARS['SERVER_NAME']) ? $HTTP_SERVER_VARS['SERVER_NAME'] :
'localhost');
$this->port = !empty($port) ? $port :
(isset($HTTP_SERVER_VARS['SERVER_PORT']) ? $HTTP_SERVER_VARS['SERVER_PORT'] :
80);
$this->path = $HTTP_SERVER_VARS['PHP_SELF'];
- $this->querystring =
$this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']);
+ $this->querystring =
isset($HTTP_SERVER_VARS['QUERY_STRING'])?$this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']):'';
$this->anchor = '';
// Parse the uri and store the various parts
@@ -241,7 +241,7 @@
*/
function getQueryString()
{
- if (!empty($this->querystring)) {
+ if (is_array($this->querystring)) {
foreach ($this->querystring as $name => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {
@@ -253,7 +253,7 @@
}
$querystring = implode('&', $querystring);
} else {
- $querystring = '';
+ $querystring = $this->querystring;
}
return $querystring;
@@ -270,6 +270,7 @@
{
parse_str($querystring, $qs);
+ if (!$qs) return $querystring;
foreach ($qs as $key => $value) {
if (is_array($value)) {
foreach ($value as $k => $v) {