diff options
author | fox <[email protected]> | 2022-09-28 19:34:43 +0300 |
---|---|---|
committer | fox <[email protected]> | 2022-09-28 19:34:43 +0300 |
commit | 051fc29b551d6426e53f440c70c3fd645aedc97f (patch) | |
tree | 12e38f54da54bd55032a5c848b81a6a819462ef5 | |
parent | d47b8c8494ed41c8a72c21b238dde74e606c5f0e (diff) | |
parent | 359f0af2e79a76fd0738133113eca0a4d59f23a7 (diff) |
Merge pull request 'Fix PHP8 strtime warning if argument is null' (#83) from mechnich/tt-rss:master into master
Reviewed-on: https://dev.tt-rss.org/fox/tt-rss/pulls/83
-rwxr-xr-x | classes/api.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/classes/api.php b/classes/api.php index 85dc5d0db..7863a213e 100755 --- a/classes/api.php +++ b/classes/api.php @@ -333,7 +333,7 @@ class API extends Handler { 'published' => self::_param_to_bool($entry->published), 'comments' => $entry->comments, 'author' => $entry->author, - 'updated' => (int) strtotime($entry->updated), + 'updated' => (int) strtotime($entry->updated ?? ''), 'feed_id' => $entry->feed_id, 'attachments' => Article::_get_enclosures($entry->id), 'score' => (int) $entry->score, @@ -618,7 +618,7 @@ class API extends Handler { 'unread' => (int) $unread, 'has_icon' => $has_icon, 'cat_id' => (int) $feed->cat_id, - 'last_updated' => (int) strtotime($feed->last_updated), + 'last_updated' => (int) strtotime($feed->last_updated ?? ''), 'order_id' => (int) $feed->order_id, ]; @@ -648,7 +648,7 @@ class API extends Handler { ->find_one($feed_id); if ($feed) { - $last_updated = strtotime($feed->last_updated); + $last_updated = strtotime($feed->last_updated ?? ''); $cache_images = self::_param_to_bool($feed->cache_images); if (!$cache_images && time() - $last_updated > 120) { @@ -725,7 +725,7 @@ class API extends Handler { "unread" => self::_param_to_bool($line["unread"]), "marked" => self::_param_to_bool($line["marked"]), "published" => self::_param_to_bool($line["published"]), - "updated" => (int)strtotime($line["updated"]), + "updated" => (int)strtotime($line["updated"] ?? ''), "is_updated" => $is_updated, "title" => $line["title"], "link" => $line["link"], |