Minor standards-compliance fix in Request_HTTP
authorDan
Sun, 24 Feb 2008 19:55:22 -0500
changeset 462 42a49ceb2373
parent 461 717e71109645
child 463 0857911fb7f1
Minor standards-compliance fix in Request_HTTP
includes/http.php
--- a/includes/http.php	Sun Feb 24 17:50:38 2008 -0500
+++ b/includes/http.php	Sun Feb 24 19:55:22 2008 -0500
@@ -356,8 +356,10 @@
       echo "<pre>";
     }
     
+    $portline = ( $this->port == 80 ) ? '' : ":$this->port";
+    
     $this->_fputs($connection, "{$this->method} {$this->uri}{$get} HTTP/1.1{$newline}");
-    $this->_fputs($connection, "Host: {$this->host}{$newline}");
+    $this->_fputs($connection, "Host: {$this->host}$portline{$newline}");
     $this->_fputs($connection, $headers);
     $this->_fputs($connection, $cookies);
     
@@ -767,7 +769,7 @@
         if ( $i > 1 )
           $get .= '&';
         $value = urlencode($value);
-        if ( !empty($value) )
+        if ( !empty($value) || is_string($value) )
           $get .= "$name=$value";
         else
           $get .= "$name";