summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat/msgformat_format.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat/msgformat_format.c')
-rwxr-xr-xext/intl/msgformat/msgformat_format.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 412a5f7b29..25bdf3691a 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -57,18 +57,20 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref,
NULL, sizeof(zval*));
- umsg_format_helper(mfo, args_copy,
- &formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
+ umsg_format_helper(mfo, args_copy, &formatted, &formatted_len TSRMLS_CC);
zend_hash_destroy(args_copy);
efree(args_copy);
- if (formatted && U_FAILURE( INTL_DATA_ERROR_CODE(mfo) ) ) {
+ if (formatted && U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
efree(formatted);
}
- INTL_METHOD_CHECK_STATUS( mfo, "Number formatting failed" );
- INTL_METHOD_RETVAL_UTF8( mfo, formatted, formatted_len, 1 );
+ if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
+ RETURN_FALSE;
+ } else {
+ INTL_METHOD_RETVAL_UTF8(mfo, formatted, formatted_len, 1);
+ }
}
/* }}} */