]> granicus.if.org Git - php/commitdiff
Ignore ordinal suffixes on numbers (bug #15210)
authorMarko Karppinen <markonen@php.net>
Thu, 24 Jan 2002 22:24:58 +0000 (22:24 +0000)
committerMarko Karppinen <markonen@php.net>
Thu, 24 Jan 2002 22:24:58 +0000 (22:24 +0000)
ext/standard/parsedate.y

index 84ee81356cb786239b80ea1eab92f5e327d2c0f7..7112b611b76cf83af2ad26d9c8950442ec167e07 100644 (file)
@@ -862,6 +862,16 @@ yylex ()
          yyInput--;
          if (sign < 0)
            yylval.Number = -yylval.Number;
+         /* Ignore ordinal suffixes on numbers */
+         c = *yyInput;
+         if (c == 's' || c == 'n' || c == 'r' || c == 't') {
+           c = *++yyInput;
+           if (c == 't' || c == 'd' || c == 'h') {
+             yyInput++;
+           } else {
+             yyInput--;
+           }
+         }
          return sign ? tSNUMBER : tUNUMBER;
        }
       if (ISALPHA (c))