]> granicus.if.org Git - php/commitdiff
Fixed bug #12934
authorIlia Alshanetsky <iliaa@php.net>
Sat, 21 Sep 2002 15:41:20 +0000 (15:41 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 21 Sep 2002 15:41:20 +0000 (15:41 +0000)
locatime() now returns an error message when passed a negative value.

ext/standard/datetime.c

index e9bc35f43e7931e6f46d0e04efea6fda381abeb1..5dc2b5d259ad78678e98a7f03017835730244ca2 100644 (file)
@@ -646,7 +646,7 @@ PHP_FUNCTION(localtime)
                        assoc_array = Z_LVAL_PP(assoc_array_arg);
                        break;
        }
-       if (NULL == (ta = php_localtime_r(&timestamp, &tmbuf))) {
+       if (timestamp < 0 || NULL == (ta = php_localtime_r(&timestamp, &tmbuf))) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid local time");
                RETURN_FALSE;
        }