mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4'
This commit is contained in:
@@ -127,10 +127,11 @@ PHP_FUNCTION( msgfmt_parse_message )
|
||||
if(spattern && spattern_len) {
|
||||
efree(spattern);
|
||||
}
|
||||
INTL_METHOD_CHECK_STATUS(mfo, "Creating message formatter failed");
|
||||
INTL_METHOD_CHECK_STATUS_OR_GOTO(mfo, "Creating message formatter failed", clean);
|
||||
|
||||
msgfmt_do_parse(mfo, source, src_len, return_value);
|
||||
|
||||
clean:
|
||||
/* drop the temporary formatter */
|
||||
msgformat_data_free(&mfo->mf_data);
|
||||
}
|
||||
|
||||
28
ext/intl/tests/gh19261.phpt
Normal file
28
ext/intl/tests/gh19261.phpt
Normal file
@@ -0,0 +1,28 @@
|
||||
--TEST--
|
||||
MessageFormatter::parseMessage() with invalid locale
|
||||
--EXTENSIONS--
|
||||
intl
|
||||
--CREDITS--
|
||||
girgias@php.net
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$locale = 'root';
|
||||
$fmt = '{0,whatever} would not work!';
|
||||
|
||||
$str = 'failing';
|
||||
|
||||
$m = MessageFormatter::parseMessage($locale, $fmt, $str);
|
||||
var_dump($m);
|
||||
var_dump(intl_get_error_message());
|
||||
|
||||
$m = msgfmt_parse_message($locale, $fmt, $str);
|
||||
var_dump($m);
|
||||
var_dump(intl_get_error_message());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
string(59) "Creating message formatter failed: U_ILLEGAL_ARGUMENT_ERROR"
|
||||
bool(false)
|
||||
string(59) "Creating message formatter failed: U_ILLEGAL_ARGUMENT_ERROR"
|
||||
Reference in New Issue
Block a user