mirror of
https://github.com/php/php-src.git
synced 2024-11-29 04:46:07 +08:00
- MFH: Fixed bug #40861 (strtotime() doesn't handle double negative relative
time units correctly).
This commit is contained in:
parent
737a66e83c
commit
b15cbf69c6
2
NEWS
2
NEWS
@ -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
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user