Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ext/intl/msgformat/msgformat_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
* as a result of that.
*/
str = zval_get_tmp_string(elem, &tmp_str);
if (!str || !ZSTR_LEN(str)) {
EG(exception) = NULL;
return;
}

UnicodeString *text = new UnicodeString();
intl_stringFromChar(*text,
Expand Down
12 changes: 12 additions & 0 deletions ext/intl/tests/gh16814.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
GH-16814 (MessageFormatter::format throws error on unused parameter)
--EXTENSIONS--
intl
--FILE--
<?php
$fmt = new MessageFormatter('de', 'Beispiel ohne Benutzung');
$fmt->format(['payed' => new DateTimeImmutable()]);
echo "OK";
?>
--EXPECT--
OK
Loading