1
0
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:
Hartmut Holzgraefe
2000-06-14 22:11:10 +00:00
parent f38e760c39
commit 9ded807a20

View File

@@ -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(&timestamp, &tmbuf);