浏览代码

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).

Thijs Kinkhorst 21 年之前
父节点
当前提交
796ddf21ee
共有 1 个文件被更改,包括 2 次插入7 次删除
  1. 2 7
      functions/global.php

+ 2 - 7
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
 ?>