From: Ilia Alshanetsky Date: Sun, 9 Mar 2008 18:10:09 +0000 (+0000) Subject: MFB: Initialize ts only after successful argument parsing X-Git-Tag: RELEASE_2_0_0a1~194 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d2827c1e6a026265262dff5b5e8af3518ffb193d;p=php MFB: Initialize ts only after successful argument parsing --- diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1c0e1e40e6..765ab59e27 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1013,12 +1013,12 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) long ts; char *string; - if (ZEND_NUM_ARGS() == 1) { - ts = time(NULL); - } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { RETURN_FALSE; } + if (ZEND_NUM_ARGS() == 1) { + ts = time(NULL); + } string = php_format_date(format, format_len, ts, localtime TSRMLS_CC);