summaryrefslogtreecommitdiff
path: root/classes/feeditem
diff options
context:
space:
mode:
authorjmechnich <[email protected]>2022-10-01 11:05:12 +0200
committerjmechnich <[email protected]>2022-10-01 11:05:12 +0200
commit560caf837768a39d7e13f067f9221347ad348774 (patch)
tree8b28a34faaac9fd848dad7503db8d6c191f894f6 /classes/feeditem
parent42bc1620b8deda73b96b2e0029c6de79daa5ccca (diff)
Fix PHP8 strtime warning if argument is null (addendum)
Diffstat (limited to 'classes/feeditem')
-rwxr-xr-xclasses/feeditem/atom.php6
-rwxr-xr-xclasses/feeditem/rss.php4
2 files changed, 5 insertions, 5 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php
index 59bf403b3..f6c96f959 100755
--- a/classes/feeditem/atom.php
+++ b/classes/feeditem/atom.php
@@ -19,19 +19,19 @@ class FeedItem_Atom extends FeedItem_Common {
$updated = $this->elem->getElementsByTagName("updated")->item(0);
if ($updated) {
- return strtotime($updated->nodeValue);
+ return strtotime($updated->nodeValue ?? '');
}
$published = $this->elem->getElementsByTagName("published")->item(0);
if ($published) {
- return strtotime($published->nodeValue);
+ return strtotime($published->nodeValue ?? '');
}
$date = $this->xpath->query("dc:date", $this->elem)->item(0);
if ($date) {
- return strtotime($date->nodeValue);
+ return strtotime($date->nodeValue ?? '');
}
// consistent with strtotime failing to parse
diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php
index 132eabff5..e07fd1d06 100755
--- a/classes/feeditem/rss.php
+++ b/classes/feeditem/rss.php
@@ -17,13 +17,13 @@ class FeedItem_RSS extends FeedItem_Common {
$pubDate = $this->elem->getElementsByTagName("pubDate")->item(0);
if ($pubDate) {
- return strtotime($pubDate->nodeValue);
+ return strtotime($pubDate->nodeValue ?? '');
}
$date = $this->xpath->query("dc:date", $this->elem)->item(0);
if ($date) {
- return strtotime($date->nodeValue);
+ return strtotime($date->nodeValue ?? '');
}
// consistent with strtotime failing to parse