Revision: 12546
http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12546&view=rev
Author: kink
Date: 2007-07-16 15:27:13 -0700 (Mon, 16 Jul 2007)
Log Message:
-----------
simplify code where possible since we don't have to support 4.0.x anymore
Modified Paths:
--------------
branches/SM-1_4-STABLE/squirrelmail/config/conf.pl
branches/SM-1_4-STABLE/squirrelmail/functions/auth.php
branches/SM-1_4-STABLE/squirrelmail/functions/global.php
branches/SM-1_4-STABLE/squirrelmail/functions/prefs.php
branches/SM-1_4-STABLE/squirrelmail/plugins/listcommands/setup.php
branches/SM-1_4-STABLE/squirrelmail/plugins/squirrelspell/sqspell_functions.php
Modified: branches/SM-1_4-STABLE/squirrelmail/config/conf.pl
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/config/conf.pl 2007-07-16 21:54:38 UTC
(rev 12545)
+++ branches/SM-1_4-STABLE/squirrelmail/config/conf.pl 2007-07-16 22:27:13 UTC
(rev 12546)
@@ -2262,9 +2262,8 @@
}
sub command310 {
- print "This option allows you to choose if users can use thread sorting\n";
- print "Your IMAP server must support the THREAD command for this to
work\n";
- print "PHP versions later than 4.0.3 recommended\n";
+ print "This option allows you to choose if users can use thread
sorting.\n";
+ print "Your IMAP server must support the THREAD command for this to
work.\n";
print "\n";
if ( lc($allow_thread_sort) eq "true" ) {
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/auth.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/auth.php 2007-07-16
21:54:38 UTC (rev 12545)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/auth.php 2007-07-16
22:27:13 UTC (rev 12546)
@@ -41,17 +41,12 @@
if ( sqsession_is_registered('user_is_logged_in') ) {
return;
} else {
- global $PHP_SELF, $HTTP_POST_VARS, $_POST, $session_expired_post,
+ global $PHP_SELF, $session_expired_post,
$session_expired_location, $squirrelmail_language;
// First we store some information in the new session to prevent
// information-loss.
- //
- if ( !check_php_version(4,1) ) {
- $session_expired_post = $HTTP_POST_VARS;
- } else {
- $session_expired_post = $_POST;
- }
+ $session_expired_post = $_POST;
$session_expired_location = $PHP_SELF;
if (!sqsession_is_registered('session_expired_post')) {
sqsession_register($session_expired_post,'session_expired_post');
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/global.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/global.php 2007-07-16
21:54:38 UTC (rev 12545)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/global.php 2007-07-16
22:27:13 UTC (rev 12546)
@@ -3,10 +3,6 @@
/**
* global.php
*
- * This includes code to update < 4.1.0 globals to the newer format
- * It also has some session register functions that work across various
- * php versions.
- *
* @copyright © 1999-2007 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
@@ -75,11 +71,7 @@
* Must be executed before strings.php is loaded (php_self() call in
strings.php).
*/
if (isset($_SERVER['PHP_SELF'])) {
- // php 4.1+
$_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']);
-} elseif (isset($HTTP_SERVER_VARS['PHP_SELF'])) {
- // php 4.0.6
- $HTTP_SERVER_VARS['PHP_SELF'] = strip_tags($HTTP_SERVER_VARS['PHP_SELF']);
}
/**
@@ -118,27 +110,7 @@
ini_set('session.use_cookies','1');
}
-/* 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.
- */
sqsession_is_active();
-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 */
@@ -222,12 +194,7 @@
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;
}
/**
@@ -239,13 +206,8 @@
sqsession_is_active();
- if ( !check_php_version(4,1) ) {
- global $HTTP_SESSION_VARS;
- unset($HTTP_SESSION_VARS[$name]);
- } else {
- unset($_SESSION[$name]);
- }
- session_unregister("$name");
+ unset($_SESSION[$name]);
+ session_unregister($name);
}
/**
@@ -256,19 +218,7 @@
*/
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;
- }
- }
-
- return $result;
+ return isset($_SESSION[$test_name]);
}
/**
@@ -294,17 +244,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
@@ -379,12 +318,7 @@
$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();
}
@@ -401,5 +335,3 @@
@session_start();
}
-// vim: et ts=4
-?>
Modified: branches/SM-1_4-STABLE/squirrelmail/functions/prefs.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/functions/prefs.php 2007-07-16
21:54:38 UTC (rev 12545)
+++ branches/SM-1_4-STABLE/squirrelmail/functions/prefs.php 2007-07-16
22:27:13 UTC (rev 12546)
@@ -24,12 +24,9 @@
$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)
+ !isset($prefs_cache) ||
+ !is_array($prefs_cache)
) {
$prefs_are_cached = false;
$prefs_cache = array();
@@ -155,4 +152,3 @@
return ($hash_dirs);
}
-?>
\ No newline at end of file
Modified: branches/SM-1_4-STABLE/squirrelmail/plugins/listcommands/setup.php
===================================================================
--- branches/SM-1_4-STABLE/squirrelmail/plugins/listcommands/setup.php
2007-07-16 21:54:38 UTC (rev 12545)
+++ branches/SM-1_4-STABLE/squirrelmail/plugins/listcommands/setup.php
2007-07-16 22:27:13 UTC (rev 12546)
@@ -42,11 +42,7 @@
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;
}
@@ -91,4 +87,3 @@
}
}
-?>
Modified:
branches/SM-1_4-STABLE/squirrelmail/plugins/squirrelspell/sqspell_functions.php
===================================================================
---
branches/SM-1_4-STABLE/squirrelmail/plugins/squirrelspell/sqspell_functions.php
2007-07-16 21:54:38 UTC (rev 12545)
+++
branches/SM-1_4-STABLE/squirrelmail/plugins/squirrelspell/sqspell_functions.php
2007-07-16 22:27:13 UTC (rev 12546)
@@ -181,14 +181,8 @@
/**
* Finish up the mcrypt routines and return the processed content.
*/
- if (function_exists('mcrypt_generic_deinit')) {
- // php 4.1.1+ syntax
- mcrypt_generic_deinit ($td);
- mcrypt_module_close ($td);
- } else {
- // older deprecated function
- mcrypt_generic_end ($td);
- }
+ mcrypt_generic_deinit ($td);
+ mcrypt_module_close ($td);
return $crypto;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
|