force ngettext() count argument type to string

This commit is contained in:
Andrew Dolgov 2017-01-22 10:18:43 +03:00
parent 0047f2578f
commit 967f0619c7
5 changed files with 8 additions and 8 deletions

View File

@ -741,7 +741,7 @@ class Feeds extends Handler_Protected {
<a title=\"".__('Edit tags for this article')."\" <a title=\"".__('Edit tags for this article')."\"
href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>"; href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>";
$num_comments = $line["num_comments"]; $num_comments = (int) $line["num_comments"];
$entry_comments = ""; $entry_comments = "";
if ($num_comments > 0) { if ($num_comments > 0) {

View File

@ -62,7 +62,7 @@ class Pref_Feeds extends Handler_Protected {
$cat['items'] = $this->get_category_items($line['id']); $cat['items'] = $this->get_category_items($line['id']);
$num_children = $this->calculate_children_count($cat); $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) if ($num_children > 0 || $show_empty_cats)
array_push($items, $cat); array_push($items, $cat);
@ -211,7 +211,7 @@ class Pref_Feeds extends Handler_Protected {
$cat['items'] = $this->get_category_items($line['id']); $cat['items'] = $this->get_category_items($line['id']);
$num_children = $this->calculate_children_count($cat); $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) if ($num_children > 0 || $show_empty_cats)
array_push($root['items'], $cat); array_push($root['items'], $cat);
@ -261,7 +261,7 @@ class Pref_Feeds extends Handler_Protected {
array_push($root['items'], $cat); array_push($root['items'], $cat);
$num_children = $this->calculate_children_count($root); $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 { } else {
$feed_result = $this->dbh->query("SELECT id, title, last_error, $feed_result = $this->dbh->query("SELECT id, title, last_error,

View File

@ -1096,7 +1096,7 @@ class Pref_Filters extends Handler_Protected {
if (!$title) $title = __("[No caption]"); 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( $result = $this->dbh->query(
@ -1114,7 +1114,7 @@ class Pref_Filters extends Handler_Protected {
if ($match_any_rule) $title .= " (" . __("matches any rule") . ")"; if ($match_any_rule) $title .= " (" . __("matches any rule") . ")";
if ($num_actions > 0) 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); return array($title, $actions);
} }

View File

@ -81,7 +81,7 @@
$class = ($feedctr % 2) ? "even" : "odd"; $class = ($feedctr % 2) ? "even" : "odd";
if ($line['articles_archived'] > 0) { 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>"; $archived = "&nbsp;<span class='subscribers'>($archived)</span>";
} else { } else {
$archived = ''; $archived = '';

View File

@ -1316,7 +1316,7 @@
$line = $p->hook_render_article($line); $line = $p->hook_render_article($line);
} }
$num_comments = $line["num_comments"]; $num_comments = (int) $line["num_comments"];
$entry_comments = ""; $entry_comments = "";
if ($num_comments > 0) { if ($num_comments > 0) {