mirror of
https://github.com/php/php-src.git
synced 2026-04-13 02:52:48 +02:00
Initialize ts only after successful argument parsing
This commit is contained in:
@@ -899,12 +899,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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user