]> granicus.if.org Git - php/commitdiff
return FALSE from strftime on negative timestamp values
authorHartmut Holzgraefe <hholzgra@php.net>
Wed, 14 Jun 2000 22:11:10 +0000 (22:11 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Wed, 14 Jun 2000 22:11:10 +0000 (22:11 +0000)
they do not make sense anyway and seem to crash win2k

ext/standard/datetime.c

index 30f0aa77781079158dd11119806d783a1fc9c9b8..d3da443f9b24ef9e26f1fb5b543f2ae2b26644aa 100644 (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);