diff options
Diffstat (limited to 'lib/gettext/gettext.php')
-rwxr-xr-x | lib/gettext/gettext.php | 4 |
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); |