mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Fixed bug #22017 (non descriptive error to appear when timestamp passed to
date() has value < 0. Win32 does not support timestamps prior to midnight (00:00:00), January 1, 1970).
This commit is contained in:
parent
d89c38961b
commit
0d2368554a
@ -286,6 +286,12 @@ php_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
|
||||
}
|
||||
convert_to_long_ex(timestamp);
|
||||
the_time = Z_LVAL_PP(timestamp);
|
||||
#ifdef PHP_WIN32
|
||||
if (the_time < 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows does not support dates prior to midnight (00:00:00), January 1, 1970");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
WRONG_PARAM_COUNT;
|
||||
|
Loading…
Reference in New Issue
Block a user