mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Number Casting allow preceding space (#14699)
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user