From 7542d00b8a5213ef83e6aff6f763645c8218e835 Mon Sep 17 00:00:00 2001 From: f0o Date: Tue, 15 Dec 2015 08:56:14 +0000 Subject: [PATCH] Fix silly JpGraph version compare --- html/includes/jpgraph/src/jpgraph.php | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/html/includes/jpgraph/src/jpgraph.php b/html/includes/jpgraph/src/jpgraph.php index f5df2afe35..a92e58836f 100644 --- a/html/includes/jpgraph/src/jpgraph.php +++ b/html/includes/jpgraph/src/jpgraph.php @@ -222,21 +222,16 @@ if (!defined('MBTTF_DIR')) { } } -// -// Check minimum PHP version -// +/* + * Check minimum PHP version + * @author f0o + * @copyright 2015 f0o, LibreNMS + * @license GPL + * @package LibreNMS + * @subpackage Billing + */ function CheckPHPVersion($aMinVersion) { - list($majorC, $minorC, $editC) = preg_split('/[\/.-]/', PHP_VERSION); - list($majorR, $minorR, $editR) = preg_split('/[\/.-]/', $aMinVersion); - - if ($majorC != $majorR) return false; - if ($majorC < $majorR) return false; - // same major - check minor - if ($minorC > $minorR) return true; - if ($minorC < $minorR) return false; - // and same minor - if ($editC >= $editR) return true; - return true; + return version_compare(PHP_VERSION, $aMinVersion, '>='); } //