mirror of
https://github.com/php/php-src.git
synced 2026-04-11 01:53:36 +02:00
return FALSE from strftime on negative timestamp values
they do not make sense anyway and seem to crash win2k
This commit is contained in:
@@ -664,6 +664,9 @@ void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm)
|
||||
if ((*format_arg)->value.str.len==0) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
if (timestamp < 0) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
format = (*format_arg)->value.str.val;
|
||||
if (gm) {
|
||||
ta = php_gmtime_r(×tamp, &tmbuf);
|
||||
|
||||
Reference in New Issue
Block a user