From 5673cabe27ab10a78e39209180d47ce4110bba52 Mon Sep 17 00:00:00 2001 From: kink Date: Tue, 3 Aug 2004 11:15:53 +0000 Subject: [PATCH] Implement php_check_version with the PHP version_compare() function which is available from v4.1.0 (and our minimum is also 4.1.0). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7820 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/global.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/functions/global.php b/functions/global.php index 1a6344bc..bed433d2 100644 --- a/functions/global.php +++ b/functions/global.php @@ -65,12 +65,7 @@ $_SERVER['PHP_SELF'] = strip_tags($_SERVER['PHP_SELF']); */ function check_php_version ($a = '0', $b = '0', $c = '0') { - global $SQ_PHP_VERSION; - - if(!isset($SQ_PHP_VERSION)) - $SQ_PHP_VERSION = substr( str_pad( preg_replace('/\D/','', PHP_VERSION), 3, '0'), 0, 3); - - return $SQ_PHP_VERSION >= ($a.$b.$c); + return version_compare ( PHP_VERSION, "$a.$b.$c", 'ge' ); } /** @@ -290,5 +285,5 @@ function sqsession_is_active() { } } - +// vim: et ts=4 ?> -- 2.25.1