diff options
author | Hartmut Holzgraefe <hholzgra@php.net> | 2000-06-14 22:11:10 +0000 |
---|---|---|
committer | Hartmut Holzgraefe <hholzgra@php.net> | 2000-06-14 22:11:10 +0000 |
commit | 9ded807a20a48d4482d21bea8cb4cc24f20f04bc (patch) | |
tree | 20197d02d76631943634401cffe40f73c05d8ba2 /ext | |
parent | f38e760c396af1a9617764fb85c03abb8637001a (diff) | |
download | php-git-9ded807a20a48d4482d21bea8cb4cc24f20f04bc.tar.gz |
return FALSE from strftime on negative timestamp values
they do not make sense anyway and seem to crash win2k
Diffstat (limited to 'ext')
-rw-r--r-- | ext/standard/datetime.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 30f0aa7778..d3da443f9b 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -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); |