diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2014-12-29 11:00:15 +0100 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2014-12-29 11:00:15 +0100 |
commit | bb3bcf0c5d27c65e955ded2304eeae1eb10a6283 (patch) | |
tree | 18c20723f2db5f66bd06a7daf44e2ee35d3e7343 /ext/intl/timezone/timezone_methods.cpp | |
parent | 2bcf69d073190e4f032d883f3416dea1b027a39e (diff) | |
parent | 78d7ad27e21f794a1d850b5c107f9534f7627ce9 (diff) | |
download | php-git-bb3bcf0c5d27c65e955ded2304eeae1eb10a6283.tar.gz |
Merge branch 'master' of https://git.php.net/push/php-src
Diffstat (limited to 'ext/intl/timezone/timezone_methods.cpp')
-rw-r--r-- | ext/intl/timezone/timezone_methods.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp index 98ae6f97aa..8a3c2cc7a8 100644 --- a/ext/intl/timezone/timezone_methods.cpp +++ b/ext/intl/timezone/timezone_methods.cpp @@ -240,18 +240,12 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) size_t region_len = 0; int32_t offset, *offsetp = NULL; - int arg3isnull = 0; - intl_error_reset(NULL); + zend_bool arg3isnull = 1; - /* must come before zpp because zpp would convert the arg in the stack to 0 */ - if (ZEND_NUM_ARGS() == 3) { - zval *dummy, *zvoffset; - arg3isnull = zend_get_parameters_ex(3, &dummy, &dummy, &zvoffset) - != FAILURE && Z_TYPE_P(zvoffset) == IS_NULL; - } + intl_error_reset(NULL); - if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l", - &zoneType, ®ion, ®ion_len, &offset_arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l!", + &zoneType, ®ion, ®ion_len, &offset_arg, &arg3isnull) == FAILURE) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intltz_create_time_zone_id_enumeration: bad arguments", 0); RETURN_FALSE; @@ -264,18 +258,15 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration) RETURN_FALSE; } - if (ZEND_NUM_ARGS() == 3) { + if (!arg3isnull) { if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) { intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "intltz_create_time_zone_id_enumeration: offset out of bounds", 0); RETURN_FALSE; } - - if (!arg3isnull) { - offset = (int32_t)offset_arg; - offsetp = &offset; - } //else leave offsetp NULL - } + offset = (int32_t)offset_arg; + offsetp = &offset; + } //else leave offsetp NULL StringEnumeration *se; UErrorCode uec = UErrorCode(); |