Browse Source

SCRIPT_FILENAME is not set on IIS 5.1 php cgi

tokul 19 years ago
parent
commit
d02c98a9e0
1 changed files with 4 additions and 3 deletions
  1. 4 3
      include/load_prefs.php

+ 4 - 3
include/load_prefs.php

@@ -12,12 +12,13 @@
  * @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();
 }