Skip to content

Commit 915fe2f

Browse files
committed
Merge branch 'PHP-7.2' into PHP-7.3
2 parents 7530938 + d2331cc commit 915fe2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/intl/msgformat/msgformat_helpers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
191191

192192
if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
193193
UnicodeString argName = mp.getSubstring(name_part);
194-
if ((storedType = (Formattable::Type*)zend_hash_str_find_ptr(ret, (char*)argName.getBuffer(), argName.length())) == NULL) {
194+
if ((storedType = (Formattable::Type*)zend_hash_str_find_ptr(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar))) == NULL) {
195195
/* not found already; create new entry in HT */
196196
Formattable::Type bogusType = Formattable::kObject;
197-
storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length(),
197+
storedType = (Formattable::Type*)zend_hash_str_update_mem(ret, (char*)argName.getBuffer(), argName.length() * sizeof(UChar),
198198
(void*)&bogusType, sizeof(bogusType));
199199
}
200200
} else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
@@ -450,7 +450,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
450450
continue;
451451
}
452452

453-
storedArgType = (Formattable::Type*)zend_hash_str_find_ptr(types, (char*)key.getBuffer(), key.length());
453+
storedArgType = (Formattable::Type*)zend_hash_str_find_ptr(types, (char*)key.getBuffer(), key.length() * sizeof(UChar));
454454
}
455455

456456
if (storedArgType != NULL) {

0 commit comments

Comments
 (0)