]> git.wh0rd.org Git - tt-rss.git/commitdiff
if-modified-since: also take last_updated into account
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 11:35:16 +0000 (15:35 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 11:35:16 +0000 (15:35 +0400)
include/rssfuncs.php

index 7c668f69f3122d8083b7f72900014894b7478eec..e2b6f57f8cf3c43730ffd541b58e7e538d289d3f 100644 (file)
                $rss = false;
                $rss_hash = false;
                $cache_timestamp = file_exists($cache_filename) ? filemtime($cache_filename) : 0;
+               $last_updated_timestamp = strtotime($last_updated);
 
                if (file_exists($cache_filename) &&
                        is_readable($cache_filename) &&
 
                        if (!$feed_data) {
                                if ($debug_enabled) {
-                                       _debug("update_rss_feed: fetching [$fetch_url] (ts: $cache_timestamp)");
+                                       _debug("update_rss_feed: fetching [$fetch_url] (ts: $cache_timestamp/$last_updated_timestamp)");
                                }
 
                                $feed_data = fetch_file_contents($fetch_url, false,
-                                       $auth_login, $auth_pass, false, $no_cache ? 15 : 45, $cache_timestamp);
+                                       $auth_login, $auth_pass, false, $no_cache ? 15 : 45,
+                                       max($last_updated_timestamp, $cache_timestamp));
 
                                if ($debug_enabled) {
                                        _debug("update_rss_feed: fetch done.");