summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo André dos Santos Lopes <cataphract@php.net>2012-05-13 18:27:14 +0200
committerGustavo André dos Santos Lopes <cataphract@php.net>2012-05-13 20:54:55 +0100
commit43ff66e0953e3664de11ffa7af27c695057cc4d6 (patch)
tree8af41fad781edbbf77ec73bac206ea9e572b2ec6
parent0295ed7d225dcd9f5cbd21cfb335912a87af894d (diff)
downloadphp-git-43ff66e0953e3664de11ffa7af27c695057cc4d6.tar.gz
Don't check number of args in msgfmt_do_format
The check does not work reliably across ICU versions when named arguments are added to the mix. For instance, for recent versions of ICU like 49, a pattern like "{foo,number} {foo}", has 0 returned from umsg_format_arg_count(), but for ICU 4.0, this returns 2.
-rwxr-xr-xext/intl/msgformat/msgformat_format.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 25bdf3691a..821adad094 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -41,17 +41,6 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
count = zend_hash_num_elements(Z_ARRVAL_P(args));
- /* umsg_format_arg_count() always returns 0 for named argument patterns,
- * so this check is ignored and un-substituted {name} strings
- * in a pattern are returned unmodified. */
- if (count < umsg_format_arg_count(MSG_FORMAT_OBJECT(mfo))) {
- /* Not enough aguments for format! */
- intl_errors_set(INTL_DATA_ERROR_P(mfo), U_ILLEGAL_ARGUMENT_ERROR,
- "msgfmt_format: not enough parameters", 0 TSRMLS_CC);
- RETVAL_FALSE;
- return;
- }
-
ALLOC_HASHTABLE(args_copy);
zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref,