瀏覽代碼

#1527493 typo in elseif.

code later tries to use $a, but it is not always available. We have if()
and elseif(). There is no failsafe else version.
tokul 19 年之前
父節點
當前提交
76e18fbaaa
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      include/init.php

+ 6 - 1
include/init.php

@@ -79,7 +79,12 @@ if (!(bool)ini_get('session.use_cookies') ||
 if (isset($_SERVER['SCRIPT_NAME'])) {
 if (isset($_SERVER['SCRIPT_NAME'])) {
     $a = explode('/',$_SERVER['SCRIPT_NAME']);
     $a = explode('/',$_SERVER['SCRIPT_NAME']);
 } elseif (isset($HTTP_SERVER_VARS['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 = '';
 $sSM_PATH = '';
 for($i = count($a) -2;$i > -1; --$i) {
 for($i = count($a) -2;$i > -1; --$i) {