From 967f0619c781a01a67f1d3c69946f63d5a4c1e54 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 22 Jan 2017 10:18:43 +0300 Subject: force ngettext() count argument type to string --- classes/pref/feeds.php | 6 +++--- classes/pref/filters.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'classes/pref') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index faef0900f..bac859d75 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -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, diff --git a/classes/pref/filters.php b/classes/pref/filters.php index 95f82765f..b7c286ecf 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -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); } -- cgit v1.2.3