http: minor fix to tolerate missing SERVER_SOFTWARE
authorDan
Sat, 28 Feb 2009 14:38:10 -0500
changeset 847 28d5049803f1
parent 846 0d2d0dfbe443
child 848 b33241a7cc28
http: minor fix to tolerate missing SERVER_SOFTWARE
includes/http.php
--- a/includes/http.php	Thu Feb 26 01:28:18 2009 -0500
+++ b/includes/http.php	Sat Feb 28 14:38:10 2009 -0500
@@ -214,7 +214,8 @@
       
     $newline = "\r\n";
     $php_ver = PHP_VERSION;
-    $this->add_header('User-Agent', "PHP/$php_ver (Server: {$_SERVER['SERVER_SOFTWARE']}; automated bot request)");
+    $server = ( isset($_SERVER['SERVER_SOFTWARE']) ) ? "Server: {$_SERVER['SERVER_SOFTWARE']}" : "CLI";
+    $this->add_header('User-Agent', "PHP/$php_ver ({$server}; automated bot request)");
   }
   
   /**