[chora] Chora.php - Use of $_SERVER

Jason Warner jason@mercuryboard.com
Sun, 2 Jun 2002 11:43:59 -0400


Hello, I found a use of $_SERVER in /lib/Chora.php revision 1.22. As you
probably know, $_SERVER was implemented in PHP 4.1.0. My patch is below. If
you need the patch in a different format, or if this isn't the correct
list/email, please tell me.


--- Chora.php 24 Apr 2002 06:38:45 -0000 1.22
+++ Chora.php 2 Jun 2002 15:33:39 -0000
@@ -112,7 +112,8 @@
 $where = preg_replace('|/$|', '', $where);

 /* Location of this script (e.g. /chora/cvs.php) */
-$scriptName = preg_replace('|^/?|', '/', $_SERVER['SCRIPT_NAME']);
+$scriptName = preg_replace('|^/?|', '/',
+    (isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] :
$HTTP_SERVER_VARS['SCRIPT_NAME']));
 $scriptName = preg_replace('|/$|', '', $scriptName);

 /* Store last file/repository viewed, and set 'where' to last_file if