Fix for infinite loop when trying to decode multi-part mime attachments
[squirrelmail.git] / functions / global.php
index 5ee2ca7e27cd9810e0ec43c3c517f3253e1ad84e..2462ac6d202bd41ef84787165b9541dfbef0edcf 100644 (file)
@@ -38,7 +38,7 @@ ini_set('magic_quotes_runtime','0');
 if ( !check_php_version(4,1) ) {
   global $_COOKIE, $_ENV, $_FILES, $_GET, $_POST, $_SERVER, $_SESSION;
   global $HTTP_COOKIE_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES, $HTTP_GET_VARS,
-         $HTTP_POST_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS;
+         $HTTP_POST_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $PHP_SELF;
   $_COOKIE  =& $HTTP_COOKIE_VARS;
   $_ENV     =& $HTTP_ENV_VARS;
   $_FILES   =& $HTTP_POST_FILES;
@@ -46,6 +46,9 @@ if ( !check_php_version(4,1) ) {
   $_POST    =& $HTTP_POST_VARS;
   $_SERVER  =& $HTTP_SERVER_VARS;
   $_SESSION =& $HTTP_SESSION_VARS;
+  if (!isset($PHP_SELF) || empty($PHP_SELF)) {
+     $PHP_SELF =  $HTTP_SERVER_VARS['PHP_SELF'];
+  }
 }
 
 /* if running with magic_quotes_gpc then strip the slashes