Fix check_php_version for versions that contain a patchlevel.
[squirrelmail.git] / functions / global.php
index ce3f5b4ae4c7c339877b7ea440f97439641f24eb..18da5f5fcd5aedea95fb3d7c76dc40ab1fc7892a 100644 (file)
@@ -53,7 +53,7 @@ function check_php_version ($a = '0', $b = '0', $c = '0')
     global $SQ_PHP_VERSION;
 
     if(!isset($SQ_PHP_VERSION))
-        $SQ_PHP_VERSION = str_pad( preg_replace('/\D/','', PHP_VERSION), 3, '0');
+        $SQ_PHP_VERSION = substr( str_pad( preg_replace('/\D/','', PHP_VERSION), 3, '0'), 0, 3);
 
     return $SQ_PHP_VERSION >= ($a.$b.$c);
 }