We don't support PHP 4.0.x anymore; update the docs to reflect that and
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 11 Mar 2004 19:34:43 +0000 (19:34 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 11 Mar 2004 19:34:43 +0000 (19:34 +0000)
remove 4.0.x legacy code.

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

ChangeLog
INSTALL
UPGRADE
functions/addressbook.php
functions/global.php
functions/imap_asearch.php
functions/prefs.php
plugins/listcommands/setup.php
src/configtest.php

index ede4d78b5c04f2a7a61639d41b7d7d85231aeeda..05185373e2f6e6255646b04021ab2a172489324a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@ Version 1.5.1 -- CVS
     functionality added to core in 1.5.0.
   - Fix test for LOGINDISABLED, should only test when the auth_mech actually
     is 'login'.
+  - Update required PHP version to 4.1.0, and remove PHP 4.0.x legacy code.
 
 Version 1.5.0
 --------------------
diff --git a/INSTALL b/INSTALL
index 04ca7186e0916492c7d11d432785640f3eacefea..b6e59660b84693ece28088eec0179c3762da3a33 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -18,7 +18,7 @@ Table of Contents:
   to run as CGI under Apache. How you end up doing this is up to you
   (your mileage may vary).
 
-  You will need at least PHP v4.0.6. If you need to upgrade please go
+  You will need at least PHP v4.1.0. If you need to upgrade please go
   ahead and install it now.
 
 a. Obtaining and compiling PHP4
diff --git a/UPGRADE b/UPGRADE
index d77082c5866fbc18b034e6006c001379465eb620..aadc72b016200d4fc03874dc4362e57a616c3c06 100644 (file)
--- a/UPGRADE
+++ b/UPGRADE
@@ -7,7 +7,7 @@ using a previous version (0.1 or 0.2), it is suggested that you just start
 from scratch and configure your settings as if it was your first install.
 
 NOTE: The new plugin architecture required the use of some functions which
-are not in all versions of PHP4. You will need at least PHP 4.0.6. If you
+are not in all versions of PHP4. You will need at least PHP 4.1.0. If you
 need to upgrade please go ahead and install the latest release version of
 PHP4.
 
index 51151df3fa83c1af4eab26b6b4301f9c1a25cbee..ef757cf6e78fe39d8cd097701165c221f9b19fd8 100644 (file)
@@ -125,6 +125,7 @@ function addressbook_init($showerr = true, $onlylocal = false) {
 /*
  *   Had to move this function outside of the Addressbook Class
  *   PHP 4.0.4 Seemed to be having problems with inline functions.
+ *   Note: this can return now since we don't support 4.0.4 anymore.
  */    
 function addressbook_cmp($a,$b) {
 
index 0c19df8867be16ffd7a227fa26dcfe9749396790..84db5ec529fdc020090151ac540d10da04af4976 100644 (file)
@@ -40,28 +40,6 @@ $uid_support = true;
 
 sqsession_is_active();
 
-/* convert old-style superglobals to current method
- * this is executed if you are running PHP 4.0.x.
- * it is run via a require_once directive in validate.php 
- * and redirect.php. Patch submitted by Ray Black.
- */ 
-
-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, $PHP_SELF;
-  $_COOKIE  =& $HTTP_COOKIE_VARS;
-  $_ENV     =& $HTTP_ENV_VARS;
-  $_FILES   =& $HTTP_POST_FILES;
-  $_GET     =& $HTTP_GET_VARS;
-  $_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
    from POST and GET global arrays */
 
@@ -148,13 +126,8 @@ function sqsession_register ($var, $name) {
 
     sqsession_is_active();
 
-    if ( !check_php_version(4,1) ) {
-        global $HTTP_SESSION_VARS;
-        $HTTP_SESSION_VARS[$name] = $var;
-    }
-    else {
-        $_SESSION["$name"] = $var; 
-    }
+    $_SESSION["$name"] = $var; 
+    
     session_register("$name");
 }
 
@@ -167,13 +140,8 @@ function sqsession_unregister ($name) {
 
     sqsession_is_active();
 
-    if ( !check_php_version(4,1) ) {
-        global $HTTP_SESSION_VARS;
-        unset($HTTP_SESSION_VARS[$name]);
-    }
-    else {
-        unset($_SESSION[$name]);
-    }
+    unset($_SESSION[$name]);
+    
     session_unregister("$name");
 }
 
@@ -186,17 +154,11 @@ function sqsession_unregister ($name) {
 function sqsession_is_registered ($name) {
     $test_name = &$name;
     $result = false;
-    if ( !check_php_version(4,1) ) {
-        global $HTTP_SESSION_VARS;
-        if (isset($HTTP_SESSION_VARS[$test_name])) {
-            $result = true;
-        }
-    }
-    else {
-        if (isset($_SESSION[$test_name])) {
-            $result = true;
-        }
+    
+    if (isset($_SESSION[$test_name])) {
+        $result = true;
     }
+    
     return $result;
 }
 
@@ -232,17 +194,6 @@ define('SQ_FORM',6);
  */
 function sqgetGlobalVar($name, &$value, $search = SQ_INORDER) {
 
-    if ( !check_php_version(4,1) ) {
-        global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, 
-               $HTTP_SERVER_VARS, $HTTP_SESSION_VARS;
-
-        $_COOKIE  =& $HTTP_COOKIE_VARS;
-        $_GET     =& $HTTP_GET_VARS;
-        $_POST    =& $HTTP_POST_VARS;
-        $_SERVER  =& $HTTP_SERVER_VARS;
-        $_SESSION =& $HTTP_SESSION_VARS;
-    }
-
     /* NOTE: DO NOT enclose the constants in the switch
        statement with quotes. They are constant values,
        enclosing them in quotes will cause them to evaluate
@@ -316,12 +267,7 @@ function sqsession_destroy() {
 
     $sessid = session_id();
     if (!empty( $sessid )) {
-        if ( !check_php_version(4,1) ) {
-            global $HTTP_SESSION_VARS;
-            $HTTP_SESSION_VARS = array();
-        } else {
-            $_SESSION = array();
-        }
+        $_SESSION = array();
         @session_destroy();
     }
 
index 23924e633f84877a5470aacb148f3dc106c42156..4222d11a1a11b4138a994be056f50a669c95e208 100644 (file)
@@ -112,8 +112,7 @@ function sqimap_asearch_error_box($response, $query, $message, $link = '')
 {
        global $imap_error_titles;
 
-       //if (!array_key_exists($response, $imap_error_titles)) //php 4.0.6 compatibility
-       if (!in_array($response, array_keys($imap_error_titles)))
+       if (!array_key_exists($response, $imap_error_titles))
                $title = _("ERROR : Unknown imap response.");
        else
                $title = $imap_error_titles[$response];
index 5876b86c04c03b527f66ca191275ee1b0c2c9fe0..112d7572abad1e0afe1e6a130b15a1e8f6a50a7a 100644 (file)
@@ -18,14 +18,9 @@ require_once(SM_PATH . 'functions/global.php');
 sqgetGlobalVar('prefs_cache', $prefs_cache, SQ_SESSION );
 sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
 
-$rg = ini_get('register_globals');
-
-/* if php version >= 4.1 OR (4.0 AND $rg = off) */
 if ( !sqsession_is_registered('prefs_are_cached') ||
      !isset( $prefs_cache) ||
-     !is_array( $prefs_cache) ||
-     check_php_version(4,1) ||
-     empty($rg)
+     !is_array( $prefs_cache) 
    ) {
     $prefs_are_cached = false;
     $prefs_cache = array();
index 8d816a8de301d0f9bd0a0736e9660c3462aa5d24..68643796c220519c3e32a6201d8246672f94b4cc 100644 (file)
@@ -44,11 +44,7 @@ function plugin_listcommands_menu() {
     foreach ($message->rfc822_header->mlist as $cmd => $actions) {
 
        /* I don't know this action... skip it */
-       if ( ( function_exists('array_key_exists') &&       /* PHP >= 4.1 */
-               !array_key_exists($cmd, $fieldsdescr) ) ||
-             ( function_exists('key_exists') && 
-               !key_exists($cmd, $fieldsdescr) )            /* PHP == 4.0.6 */
-        ) {
+       if ( !array_key_exists($cmd, $fieldsdescr) ) {
             continue;
         }
 
index b3f6324e1b99c2ee64c694268dbe96554f521c5a..bc0b9528595ea141d418feba6494b1c4edf73c8f 100644 (file)
@@ -72,8 +72,8 @@ echo '<p>SquirrelMail version: '.$version.'<br />'.
 
 echo "Checking PHP configuration...<br />\n";
 
-if(!check_php_version(4,0,6)) {
-    do_err('Insufficient PHP version: '. PHP_VERSION . '! Minimum required: 4.0.6');
+if(!check_php_version(4,1,0)) {
+    do_err('Insufficient PHP version: '. PHP_VERSION . '! Minimum required: 4.1.0');
 }
 
 echo $IND . 'PHP version '.PHP_VERSION.' OK.<br />';