Skip to content

Commit bb3bcf0

Browse files
committed
Merge branch 'master' of https://git.php.net/push/php-src
2 parents 2bcf69d + 78d7ad2 commit bb3bcf0

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

ext/intl/collator/collator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
#ifndef COLLATOR_COLLATOR_H
19-
#define CCOLLATOR_COLLATOR_H
19+
#define COLLATOR_COLLATOR_H
2020

2121
#include <php.h>
2222

ext/intl/timezone/timezone_methods.cpp

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,12 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
240240
size_t region_len = 0;
241241
int32_t offset,
242242
*offsetp = NULL;
243-
int arg3isnull = 0;
244-
intl_error_reset(NULL);
243+
zend_bool arg3isnull = 1;
245244

246-
/* must come before zpp because zpp would convert the arg in the stack to 0 */
247-
if (ZEND_NUM_ARGS() == 3) {
248-
zval *dummy, *zvoffset;
249-
arg3isnull = zend_get_parameters_ex(3, &dummy, &dummy, &zvoffset)
250-
!= FAILURE && Z_TYPE_P(zvoffset) == IS_NULL;
251-
}
245+
intl_error_reset(NULL);
252246

253-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l",
254-
&zoneType, &region, &region_len, &offset_arg) == FAILURE) {
247+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|s!l!",
248+
&zoneType, &region, &region_len, &offset_arg, &arg3isnull) == FAILURE) {
255249
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
256250
"intltz_create_time_zone_id_enumeration: bad arguments", 0);
257251
RETURN_FALSE;
@@ -264,18 +258,15 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone_id_enumeration)
264258
RETURN_FALSE;
265259
}
266260

267-
if (ZEND_NUM_ARGS() == 3) {
261+
if (!arg3isnull) {
268262
if (offset_arg < (zend_long)INT32_MIN || offset_arg > (zend_long)INT32_MAX) {
269263
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
270264
"intltz_create_time_zone_id_enumeration: offset out of bounds", 0);
271265
RETURN_FALSE;
272266
}
273-
274-
if (!arg3isnull) {
275-
offset = (int32_t)offset_arg;
276-
offsetp = &offset;
277-
} //else leave offsetp NULL
278-
}
267+
offset = (int32_t)offset_arg;
268+
offsetp = &offset;
269+
} //else leave offsetp NULL
279270

280271
StringEnumeration *se;
281272
UErrorCode uec = UErrorCode();

ext/standard/string.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5385,6 +5385,7 @@ PHP_FUNCTION(money_format)
53855385
double value;
53865386
zend_bool check = 0;
53875387
zend_string *str;
5388+
ssize_t res_len;
53885389

53895390
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sd", &format, &format_len, &value) == FAILURE) {
53905391
return;
@@ -5405,10 +5406,11 @@ PHP_FUNCTION(money_format)
54055406
}
54065407

54075408
str = zend_string_alloc(format_len + 1024, 0);
5408-
if ((str->len = strfmon(str->val, str->len, format, value)) < 0) {
5409+
if ((res_len = strfmon(str->val, str->len, format, value)) < 0) {
54095410
zend_string_free(str);
54105411
RETURN_FALSE;
54115412
}
5413+
str->len = (size_t)res_len;
54125414
str->val[str->len] = '\0';
54135415

54145416
RETURN_NEW_STR(zend_string_realloc(str, str->len, 0));

0 commit comments

Comments
 (0)