]> git.wh0rd.org - tt-rss.git/commitdiff
fix http 304 header being calculated incorrectly for published and starred feeds
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 4 Oct 2013 05:10:44 +0000 (09:10 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 4 Oct 2013 05:10:44 +0000 (09:10 +0400)
classes/handler/public.php

index 649fc31aa28f4509f7dfd1db52d4c4d4907009d0..c5a2a03cb3bb620c7eaca83b5d91cf11c83f25f1 100644 (file)
@@ -15,11 +15,15 @@ class Handler_Public extends Handler {
                if (!$limit) $limit = 60;
 
                $date_sort_field = "date_entered DESC, updated DESC";
+               $date_check_field = "date_entered";
 
-               if ($feed == -2)
+               if ($feed == -2 && !$is_cat) {
                        $date_sort_field = "last_published DESC";
-               else if ($feed == -1)
+                       $date_check_field = "last_published";
+               } else if ($feed == -1 && !$is_cat) {
                        $date_sort_field = "last_marked DESC";
+                       $date_check_field = "last_marked";
+               }
 
                switch ($order) {
                case "title":
@@ -41,7 +45,8 @@ class Handler_Public extends Handler {
                $result = $qfh_ret[0];
 
                if ($this->dbh->num_rows($result) != 0) {
-                       $ts = strtotime($this->dbh->fetch_result($result, 0, "date_entered"));
+
+                       $ts = strtotime($this->dbh->fetch_result($result, 0, $date_check_field));
 
                        if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
                                        strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= $ts) {