From aa5205b95e6213dec955c5b6a3d8edfffc8c2faa Mon Sep 17 00:00:00 2001 From: Jamie Baker Date: Tue, 2 Nov 2021 04:18:21 +0000 Subject: [PATCH] airos: fix latitude having an extra - in the middle after the decimal point (#13454) * fix latitude having an extra - in the middle after the decimal point fix latitude having an extra - in the middle after the decimal point * consolidate * style Co-authored-by: Tony Murray --- LibreNMS/OS/Airos.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/LibreNMS/OS/Airos.php b/LibreNMS/OS/Airos.php index ee66b3e209..ccfbca7979 100644 --- a/LibreNMS/OS/Airos.php +++ b/LibreNMS/OS/Airos.php @@ -73,8 +73,10 @@ class Airos extends OS implements { $location = parent::fetchLocation(); - // fix longitude having an extra - in the middle after the decimal point - $location->lng = (float) preg_replace('/(-?\d+)\.-?(\d+)/', '$1.$2', $location->getAttributes()['lng']); + // fix having an extra - in the middle after the decimal point + $regex = '/(-?\d+)\.-?(\d+)/'; + $location->lng = (float) preg_replace($regex, '$1.$2', $location->getAttributes()['lng']); + $location->lat = (float) preg_replace($regex, '$1.$2', $location->getAttributes()['lat']); return $location; }