]> git.wh0rd.org Git - tt-rss.git/commitdiff
force ngettext() count argument type to string
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 22 Jan 2017 07:18:43 +0000 (10:18 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 22 Jan 2017 07:18:43 +0000 (10:18 +0300)
classes/feeds.php
classes/pref/feeds.php
classes/pref/filters.php
include/feedbrowser.php
include/functions2.php

index 8f101e5cb774e46c74f027fd9100665d1d2bb423..e0756b6640a6a43a88c83bd1891e109d242ece1b 100755 (executable)
@@ -741,7 +741,7 @@ class Feeds extends Handler_Protected {
                                                <a title=\"".__('Edit tags for this article')."\"
                                                href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>";
 
-                                       $num_comments = $line["num_comments"];
+                                       $num_comments = (int) $line["num_comments"];
                                        $entry_comments = "";
 
                                        if ($num_comments > 0) {
index faef0900fc05b779c771e756c63653c11cefd7cb..bac859d7524d3a5b23a878aa0c3bb7cc32871dcb 100755 (executable)
@@ -62,7 +62,7 @@ class Pref_Feeds extends Handler_Protected {
                        $cat['items'] = $this->get_category_items($line['id']);
 
                        $num_children = $this->calculate_children_count($cat);
-                       $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+                       $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
 
                        if ($num_children > 0 || $show_empty_cats)
                                array_push($items, $cat);
@@ -211,7 +211,7 @@ class Pref_Feeds extends Handler_Protected {
                                $cat['items'] = $this->get_category_items($line['id']);
 
                                $num_children = $this->calculate_children_count($cat);
-                               $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+                               $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
 
                                if ($num_children > 0 || $show_empty_cats)
                                        array_push($root['items'], $cat);
@@ -261,7 +261,7 @@ class Pref_Feeds extends Handler_Protected {
                                array_push($root['items'], $cat);
 
                        $num_children = $this->calculate_children_count($root);
-                       $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+                       $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
 
                } else {
                        $feed_result = $this->dbh->query("SELECT id, title, last_error,
index 95f82765fe7cb80206de73a36120ff071b4a3240..b7c286ecf2665c41c71eec2eef077ae715e25eba 100755 (executable)
@@ -1096,7 +1096,7 @@ class Pref_Filters extends Handler_Protected {
 
                if (!$title) $title = __("[No caption]");
 
-               $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", $num_rules), $title, $num_rules);
+               $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", (int) $num_rules), $title, $num_rules);
 
 
                $result = $this->dbh->query(
@@ -1114,7 +1114,7 @@ class Pref_Filters extends Handler_Protected {
                if ($match_any_rule) $title .= " (" . __("matches any rule") . ")";
 
                if ($num_actions > 0)
-                       $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", $num_actions), $actions, $num_actions);
+                       $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", (int) $num_actions), $actions, $num_actions);
 
                return array($title, $actions);
        }
index 800bcd970c6026bedffa29510356ce3e7f596815..4772420abb8f4cc4f0951555f0f0c193e4d717e0 100644 (file)
@@ -81,7 +81,7 @@
                                $class = ($feedctr % 2) ? "even" : "odd";
 
                                if ($line['articles_archived'] > 0) {
-                                       $archived = sprintf(_ngettext("%d archived article", "%d archived articles", $line['articles_archived']), $line['articles_archived']);
+                                       $archived = sprintf(_ngettext("%d archived article", "%d archived articles", (int) $line['articles_archived']), $line['articles_archived']);
                                        $archived = "&nbsp;<span class='subscribers'>($archived)</span>";
                                } else {
                                        $archived = '';
index 4535e62670a9d4217b4c20681d7464bfc6b706ac..28477a0cfd0c7447f5a0237eae0d5fca6f2d7eaf 100644 (file)
                                $line = $p->hook_render_article($line);
                        }
 
-                       $num_comments = $line["num_comments"];
+                       $num_comments = (int) $line["num_comments"];
                        $entry_comments = "";
 
                        if ($num_comments > 0) {