From 8f8b521a0de1233b9a79d94e81d63f717139b96c Mon Sep 17 00:00:00 2001
From: Kevin Abel <kevin.abel.0@gmail.com>
Date: Tue, 2 Sep 2014 17:00:22 -0500
Subject: [PATCH] Fix syntax to be 5.3 safe
Dereferencing the new operator is only 5.4 ready.
---
scripts/functions.inc.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/functions.inc.php b/scripts/functions.inc.php
index ec9c5b8..2db3a90 100644
--- a/scripts/functions.inc.php
+++ b/scripts/functions.inc.php
@@ -13,11 +13,14 @@ function getCAPData()
if (stripos($item->description, 'test')) {
$isTest = true;
}
+
+ $pubDate = (string) $item->children('dc', true)->date;
+ $pubDateTime = new DateTime($pubDate);
$output = array(
- 'identifier' => md5((string) $item->children('dc', true)->date),
+ 'identifier' => md5($pubDate),
'sender' => 'police.unl.edu',
- 'sent' => (new DateTime((string) $item->children('dc', true)->date))->format(DateTime::ATOM),
+ 'sent' => $pubDateTime->format(DateTime::ATOM),
'status' => $isTest ? 'Test' : 'Actual',
'msgType' => 'Alert',
'scope' => 'Public',
--
GitLab