mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
MFB: The 2am offset was a bad choice as this hour doesn't necessarily exist
on a DST switch. So use 4am instead. Fixes bug #27719
This commit is contained in:
parent
c52cc1c333
commit
a40518164b
@ -191,12 +191,12 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
|
||||
val = (*arguments[0])->value.lval;
|
||||
/*
|
||||
We don't use 1 here to work around problems in some mktime implementations
|
||||
when it comes to daylight savings time. Setting it to 2 and working back from
|
||||
when it comes to daylight savings time. Setting it to 4 and working back from
|
||||
there with the chgsecs offset makes us immune to these problems.
|
||||
See http://bugs.php.net/27533 for more info.
|
||||
*/
|
||||
if (val < 2) {
|
||||
chgsecs += (2-val) * 60*60; val = 2;
|
||||
if (val < 4) {
|
||||
chgsecs += (4-val) * 60*60; val = 4;
|
||||
}
|
||||
ta->tm_hour = val;
|
||||
/* fall-through */
|
||||
|
Loading…
Reference in New Issue
Block a user