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:
Ilia Alshanetsky 2003-02-03 22:48:26 +00:00
parent d89c38961b
commit 0d2368554a

View File

@ -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;