Implement php_check_version with the PHP version_compare() function which
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Aug 2004 11:15:53 +0000 (11:15 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 3 Aug 2004 11:15:53 +0000 (11:15 +0000)
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

index 1a6344bc2b59f7440c8afad18291b839b79a63d3..bed433d2c0824ad89ebd037e01ed7bee7874a368 100644 (file)
@@ -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
 ?>