#1527493 typo in elseif.
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jul 2006 19:20:24 +0000 (19:20 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 24 Jul 2006 19:20:24 +0000 (19:20 +0000)
code later tries to use $a, but it is not always available. We have if()
and elseif(). There is no failsafe else version.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11432 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/init.php

index 2755e08044c805d402b20c23ebb28f6b5bcbc16b..265440f465b4894c040873c362055e861a50e264 100644 (file)
@@ -79,7 +79,12 @@ if (!(bool)ini_get('session.use_cookies') ||
 if (isset($_SERVER['SCRIPT_NAME'])) {
     $a = explode('/',$_SERVER['SCRIPT_NAME']);
 } elseif (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
-    $a = explode('/',$_SERVER['SCRIPT_NAME']);
+    $a = explode('/',$HTTP_SERVER_VARS['SCRIPT_NAME']);
+} else {
+    $error = 'Unable to detect script environment. '
+       .'Please test your PHP settings and send PHP core config, $_SERVER '
+       .'and $HTTP_SERVER_VARS to SquirrelMail developers.';
+    die($error);
 }
 $sSM_PATH = '';
 for($i = count($a) -2;$i > -1; --$i) {