SCRIPT_FILENAME is not set on IIS 5.1 php cgi
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 21 May 2006 18:45:27 +0000 (18:45 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 21 May 2006 18:45:27 +0000 (18:45 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11151 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/load_prefs.php

index d6e30f3..626c07c 100644 (file)
  * @package squirrelmail
  */
 
-
 /**
  * do not allow to call this file directly
+ * FIXME: PHP CGI (at least on IIS 5.1) does not set 'SCRIPT_FILENAME' and
+ * code does not handle magic_quotes_gpc=on.
  */
-if ((isset($_SERVER) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) ||
-     (isset($HTTP_SERVER_SERVER) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) {
+if ((isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) ||
+     (isset($HTTP_SERVER_SERVER['SCRIPT_FILENAME']) && $HTTP_SERVER_SERVER['SCRIPT_FILENAME'] == __FILE__) ) {
     header("Location: ../src/login.php");
     die();
 }