From: Marko Karppinen Date: Thu, 24 Jan 2002 22:24:58 +0000 (+0000) Subject: Ignore ordinal suffixes on numbers (bug #15210) X-Git-Tag: PRE_ISSET_PATCH~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=449b53e34a687005eeba239f2ead360bd65c1b5a;p=php Ignore ordinal suffixes on numbers (bug #15210) --- diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y index 84ee81356c..7112b611b7 100644 --- a/ext/standard/parsedate.y +++ b/ext/standard/parsedate.y @@ -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))