diff options
author | Andrew Dolgov <[email protected]> | 2021-04-02 10:28:34 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-04-02 10:28:34 +0300 |
commit | c03252dd895617ee224dfa7b7f12b090fbf23fc3 (patch) | |
tree | 7bcd4800d48c1980737cb540ebed55403dbc1a0a | |
parent | 57b22ce4b10c6d2e36acb4e33f6bfcb6789bb8a3 (diff) |
fix processing for entries with unset timestamp
-rwxr-xr-x | init.php | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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()), |