From e84b2c0c75b4258db28f0d56255a94d677d1bc53 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 15 Dec 2022 16:01:01 -0600 Subject: [PATCH] Number Casting allow preceding space (#14699) --- LibreNMS/Util/Number.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibreNMS/Util/Number.php b/LibreNMS/Util/Number.php index 40cf74c0f0..8b3baceee0 100644 --- a/LibreNMS/Util/Number.php +++ b/LibreNMS/Util/Number.php @@ -97,7 +97,7 @@ class Number { if (! is_numeric($number)) { // match pre-PHP8 behavior - if (! preg_match('/^-?\d+(\.\d+)?/', $number ?? '', $matches)) { + if (! preg_match('/^\s*-?\d+(\.\d+)?/', $number ?? '', $matches)) { return 0; } $number = $matches[0];