Browse Source

MFB51: Fixed bug #36510 (strtotime() fails to parse date strings with tabs).

migration/RELEASE_1_0_0
Ilia Alshanetsky 21 years ago
parent
commit
4c722c519f
  1. 9118
      ext/date/lib/parse_date.c
  2. 4
      ext/date/lib/parse_date.re
  3. 14
      ext/date/tests/bug36510.phpt

9118
ext/date/lib/parse_date.c
File diff suppressed because it is too large
View File

4
ext/date/lib/parse_date.re

@ -535,7 +535,7 @@ static long timelib_get_month(char **ptr)
static void timelib_eat_spaces(char **ptr)
{
while (**ptr == ' ') {
while (**ptr == ' ' || **ptr == '\t') {
++*ptr;
}
}
@ -736,7 +736,7 @@ std:
/*!re2c
any = [\000-\377];
space = [ ]+;
space = [ \t]+;
frac = "."[0-9]+;
ago = 'ago';

14
ext/date/tests/bug36510.phpt

@ -0,0 +1,14 @@
--TEST--
Bug #36510 (strtotime() fails to parse date strings with tabs)
--FILE--
<?php
date_default_timezone_set("UTC");
$t = 1140973388;
var_dump(strtotime("-2 hours", $t));
var_dump(strtotime("-2\thours", $t));
?>
--EXPECT--
int(1140966188)
int(1140966188)
Loading…
Cancel
Save