Fix #70245: strtotime does not emit warning when 2nd parameter is object or string

Caused by a refactoring strtotime() called
zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ...) instead of
zend_parse_parameters().
This commit is contained in:
Christoph M. Becker 2015-08-12 19:01:04 +02:00
parent 2366a070c8
commit 3b874086e2
2 changed files with 11 additions and 1 deletions

View File

@ -1461,7 +1461,7 @@ PHP_FUNCTION(strtotime)
timelib_time *t, *now;
timelib_tzinfo *tzi;
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "s|l", &times, &time_len, &preset_ts) == FAILURE || !time_len) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &times, &time_len, &preset_ts) == FAILURE || !time_len) {
RETURN_FALSE;
}

View File

@ -0,0 +1,10 @@
--TEST--
Bug #70245 (strtotime does not emit warning when 2nd parameter is object or string)
--FILE--
<?php
$d = new DateTime('2011-01-15 00:00:00');
var_dump(strtotime('-1 month', $d));
?>
--EXPECTF--
Warning: strtotime() expects parameter 2 to be integer, object given in %sbug70245.php on line %d
bool(false)