summaryrefslogtreecommitdiff
path: root/lib/gettext/gettext.php
diff options
context:
space:
mode:
authorAnders Kaseorg <[email protected]>2017-01-20 14:49:24 -0500
committerAnders Kaseorg <[email protected]>2017-01-21 15:01:14 -0500
commit526096f06a7916fca71af48814c90d33c8e02641 (patch)
tree5b46d88a3143d669cf23a5539b8d7c7a598660ac /lib/gettext/gettext.php
parente3cfa33ba92c620d1e302ee253da259e1abf4589 (diff)
lib: Upgrade php-gettext from 1.0.11 to 1.0.12
https://launchpad.net/php-gettext The local change to rename the gettext_reader function to __construct (commit 00b6b66827c5ce0c103399f2742581fa90d50a97) has been preserved. Signed-off-by: Anders Kaseorg <[email protected]>
Diffstat (limited to 'lib/gettext/gettext.php')
-rwxr-xr-xlib/gettext/gettext.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gettext/gettext.php b/lib/gettext/gettext.php
index 81af55509..edbd93304 100755
--- a/lib/gettext/gettext.php
+++ b/lib/gettext/gettext.php
@@ -350,6 +350,10 @@ class gettext_reader {
* @return int array index of the right plural form
*/
function select_string($n) {
+ if (!is_int($n)) {
+ throw new InvalidArgumentException(
+ "Select_string only accepts integers: " . $n);
+ }
$string = $this->get_plural_forms();
$string = str_replace('nplurals',"\$total",$string);
$string = str_replace("n",$n,$string);