summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Karppinen <markonen@php.net>2002-01-24 22:24:58 +0000
committerMarko Karppinen <markonen@php.net>2002-01-24 22:24:58 +0000
commit449b53e34a687005eeba239f2ead360bd65c1b5a (patch)
treef18ab58a7664ec9ff66b47e56984bf552a194678
parentfd7ff95fde48d2b941d00ea4b461131c83240668 (diff)
downloadphp-git-449b53e34a687005eeba239f2ead360bd65c1b5a.tar.gz
Ignore ordinal suffixes on numbers (bug #15210)
-rw-r--r--ext/standard/parsedate.y10
1 files changed, 10 insertions, 0 deletions
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))