summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-04-02 10:28:34 +0300
committerAndrew Dolgov <[email protected]>2021-04-02 10:28:34 +0300
commitc03252dd895617ee224dfa7b7f12b090fbf23fc3 (patch)
tree7bcd4800d48c1980737cb540ebed55403dbc1a0a
parent57b22ce4b10c6d2e36acb4e33f6bfcb6789bb8a3 (diff)
fix processing for entries with unset timestamp
-rwxr-xr-xinit.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/init.php b/init.php
index 0414623..81568db 100755
--- a/init.php
+++ b/init.php
@@ -196,7 +196,12 @@ class Reddit_Delay extends Plugin {
$cutoff_timestamp = time() - ($delay * 60 * 60);
- if ($item->get_date() > $cutoff_timestamp) {
+ // get_date() may not return anything for broken feeds
+ $item_timestamp = (int)$item->get_date();
+
+ if (!$item_timestamp) $item_timestamp = time();
+
+ if ($item_timestamp > $cutoff_timestamp) {
Debug::log(sprintf("[delay] %s [%s vs %s]",
$item->get_link(),
date("Y-m-d H:i:s", $item->get_date()),