diff options
author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-05-06 23:45:08 +0200 |
---|---|---|
committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-05-13 20:53:06 +0100 |
commit | 1c4f99b98828bb752794e0fc45bd3884848b001d (patch) | |
tree | 09e7728e2ac68d636c9757d38f23d4954fd62354 /ext/intl/msgformat/msgformat_format.c | |
parent | 0ad1b14f16262f77372620992a72dd3f12c5e24b (diff) | |
download | php-git-1c4f99b98828bb752794e0fc45bd3884848b001d.tar.gz |
Better error messages in MessageFormatter::format.
Diffstat (limited to 'ext/intl/msgformat/msgformat_format.c')
-rwxr-xr-x | ext/intl/msgformat/msgformat_format.c | 12 |
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); + } } /* }}} */ |