- MFH: Fixed bug #40861 (strtotime() doesn't handle double negative relative

time units correctly).
This commit is contained in:
Derick Rethans 2007-04-11 14:37:42 +00:00
parent 737a66e83c
commit b15cbf69c6
4 changed files with 8169 additions and 8133 deletions

2
NEWS
View File

@ -1,6 +1,8 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Apr 2007, PHP 5.2.2RC2
- Fixed bug #40861 (strtotime() doesn't handle double negative relative time
units correctly). (Derick)
10 Apr 2007, PHP 5.2.2RC1
- Improved bundled GD

File diff suppressed because it is too large Load Diff

View File

@ -448,10 +448,12 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length)
}
++*ptr;
}
if (**ptr == '+') {
++*ptr;
} else if (**ptr == '-') {
dir = -1;
while (**ptr == '+' || **ptr == '-')
{
if (**ptr == '-') {
dir *= -1;
}
++*ptr;
}
return dir * timelib_get_nr(ptr, max_length);
@ -875,7 +877,7 @@ dateshortwithtimelongtz = datenoyear iso8601normtz;
reltextnumber = 'first'|'next'|'second'|'third'|'fourth'|'fifth'|'sixth'|'seventh'|'eight'|'ninth'|'tenth'|'eleventh'|'twelfth'|'last'|'previous'|'this';
reltextunit = (('sec'|'second'|'min'|'minute'|'hour'|'day'|'week'|'fortnight'|'forthnight'|'month'|'year') 's'?) | daytext;
relnumber = ([+-]?[ \t]*[0-9]+);
relnumber = ([+-]*[ \t]*[0-9]+);
relative = relnumber space? reltextunit;
relativetext = reltextnumber space reltextunit;

View File

@ -29,5 +29,5 @@ echo $result . "\n";
--EXPECT--
2000-01-01 13:00:00
2000-01-01 11:00:00
2000-01-01 11:00:00
2000-01-01 13:00:00
2000-01-01 13:00:00