From ef4b663b8c41700365b4fe9525799e9b2f43ee1a Mon Sep 17 00:00:00 2001 From: Tom King Date: Tue, 14 Jan 2020 08:08:04 +0000 Subject: [PATCH] fix: Incorrect directionality for oldest_timestamp comparisons --- app/Controller/EventsController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index 691dbdd96..96e8e43b3 100644 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -1309,7 +1309,7 @@ class EventsController extends AppController foreach ($event['Object'] as $k => $object) { if (!empty($object['Attribute'])) { foreach ($object['Attribute'] as $attribute) { - if ($oldest_timestamp == false || $oldest_timestamp < $attribute['timestamp']) { + if ($oldest_timestamp == false || $oldest_timestamp > $attribute['timestamp']) { $oldest_timestamp = $attribute['timestamp']; } } @@ -1407,7 +1407,7 @@ class EventsController extends AppController $startDate = null; $modificationMap = array(); foreach ($event['Attribute'] as $k => $attribute) { - if ($oldest_timestamp == false || $oldest_timestamp < $attribute['timestamp']) { + if ($oldest_timestamp == false || $oldest_timestamp > $attribute['timestamp']) { $oldest_timestamp = $attribute['timestamp']; } if ($startDate === null || $attribute['timestamp'] < $startDate) {