From 78f3ad40a890703fb5ac792d725ed09927e3e3b8 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 21 Sep 2002 15:41:20 +0000 Subject: [PATCH] Fixed bug #12934 locatime() now returns an error message when passed a negative value. --- ext/standard/datetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index e9bc35f43e..5dc2b5d259 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -646,7 +646,7 @@ PHP_FUNCTION(localtime) assoc_array = Z_LVAL_PP(assoc_array_arg); break; } - if (NULL == (ta = php_localtime_r(×tamp, &tmbuf))) { + if (timestamp < 0 || NULL == (ta = php_localtime_r(×tamp, &tmbuf))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid local time"); RETURN_FALSE; } -- 2.50.1