]> git.wh0rd.org - tt-rss.git/commitdiff
queryfeedheadlines: there's no need to quote order_by/override_order
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 3 Dec 2017 19:49:57 +0000 (22:49 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 3 Dec 2017 19:49:57 +0000 (22:49 +0300)
else: feedicon cache busting etc

classes/api.php
classes/counters.php
classes/feeds.php
include/functions.php
js/feedlist.js

index aa5964200ba00b005dedfcbac4a6cc2c08dac995..c28d36524aa850ae8ee84f1d55deaef48a668933 100644 (file)
@@ -633,7 +633,7 @@ class API extends Handler {
 
                                $unread = getFeedUnread($line["id"]);
 
-                               $has_icon = feed_has_icon($line['id']);
+                               $has_icon = Feeds::feedHasIcon($line['id']);
 
                                if ($unread || !$unread_only) {
 
index 54e4041f50071a14ecc3ee9d5f815e4ae5370f04..2de7d5a3af22d41e65afcf62662390c556bd7e01 100644 (file)
@@ -183,7 +183,11 @@ class Counters {
 
                        $last_updated = make_local_datetime($line['last_updated'], false);
 
-                       $has_img = feed_has_icon($id);
+                       if (Feeds::feedHasIcon($id)) {
+                               $has_img = filemtime(Feeds::getIconFile($id));
+                       } else {
+                               $has_img = false;
+                       }
 
                        if (date('Y') - date('Y', strtotime($line['last_updated'])) > 2)
                                $last_updated = '';
index 07dd2a600b4f3883e56f3785d6f7a1e19d343606..b52b580f423061b101cdc9ce4fa7f17099c05ffe 100755 (executable)
@@ -414,7 +414,7 @@ class Feeds extends Handler_Protected {
                 $entry_author = " &mdash; $entry_author";
             }
 
-            $has_feed_icon = feed_has_icon($feed_id);
+            $has_feed_icon = feeds::feedHasIcon($feed_id);
 
             if ($has_feed_icon) {
                 $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
@@ -537,20 +537,12 @@ class Feeds extends Handler_Protected {
                 if ($vfeed_group_enabled && $line["feed_title"]) {
                     if ($feed_id != $vgroup_last_feed) {
 
-                        $cur_feed_title = $line["feed_title"];
                         $vgroup_last_feed = $feed_id;
 
-                        $cur_feed_title = htmlspecialchars($cur_feed_title);
-
                         $vf_catchup_link = "<a class='catchup' onclick='catchupFeedInGroup($feed_id);' href='#'>".__('mark feed as read')."</a>";
 
-                        $has_feed_icon = feed_has_icon($feed_id);
-
-                        if ($has_feed_icon) {
-                            $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
-                        } else {
-                            //$feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/blank_icon.gif\" alt=\"\">";
-                        }
+                        $feed_icon_src = Feeds::getFeedIcon($feed_id);
+                        $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"$feed_icon_src\">";
 
                         $reply['content'] .= "<div data-feed-id='$feed_id' id='FTITLE-$feed_id' class='cdmFeedTitle'>".
                             "<div style=\"float : right\">$feed_icon_img</div>".
@@ -1590,6 +1582,10 @@ class Feeds extends Handler_Protected {
                return ICONS_DIR . "/$feed_id.ico";
        }
 
+       static function feedHasIcon($id) {
+               return is_file(ICONS_DIR . "/$id.ico") && filesize(ICONS_DIR . "/$id.ico") > 0;
+       }
+
        static function getFeedIcon($id) {
                switch ($id) {
                        case 0:
@@ -2052,9 +2048,9 @@ class Feeds extends Handler_Protected {
                        // proper override_order applied above
                        if ($vfeed_query_part && !$ignore_vfeed_group && get_pref('VFEED_GROUP_BY_FEED', $owner_uid)) {
                                if (!$override_order) {
-                                       $order_by = "ttrss_feeds.title, ".$pdo->quote($order_by);
+                                       $order_by = "ttrss_feeds.title, ".$order_by;
                                } else {
-                                       $order_by = "ttrss_feeds.title, ".$pdo->quote($override_order);
+                                       $order_by = "ttrss_feeds.title, ".$override_order;
                                }
                        }
 
index fc0cdec7c67b166aaba9e564738a5c4e173d1f73..417abfbb87d0000c56635f1122e9ff66a0ab11b4 100644 (file)
                }
        }
 
-       function feed_has_icon($id) {
-               return is_file(ICONS_DIR . "/$id.ico") && filesize(ICONS_DIR . "/$id.ico") > 0;
-       }
-
        function init_plugins() {
                PluginHost::getInstance()->load(PLUGINS, PluginHost::KIND_ALL);
 
index d9bc0a0c9f768840b3c7516a61330a683636d0c7..1e783f3b37f0e215a66143bbad08c9d9852b7cac 100644 (file)
@@ -326,7 +326,7 @@ function parse_counters(elems) {
                        if (id > 0) {
                                if (has_img) {
                                        setFeedIcon(id, false,
-                                               getInitParam("icons_url") + "/" + id + ".ico");
+                                               getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
                                } else {
                                        setFeedIcon(id, false, 'images/blank_icon.gif');
                                }