]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
php-gettext extlib updated as req !88
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 28 Jan 2016 13:40:47 +0000 (14:40 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 28 Jan 2016 13:41:25 +0000 (14:41 +0100)
Thanks postblue

extlib/php-gettext/gettext.php

index 5064047cbd2427248c2a058e8ac09640bcb6c503..171d14e23d8a218e548511438a4c328aa587a224 100644 (file)
@@ -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);