Skip to content
Merged
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 NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ PHP NEWS
. Fixed bug GH-23242 (PHP development server does not support Expect
100-continue flow control). (Sjoerd Langkemper)

- Intl:
. Fixed a leak in Locale::getKeywords() when a keyword value cannot be
read. (iliaal)


27 Aug 2026, PHP 8.6.0beta2

Expand Down
1 change: 1 addition & 0 deletions ext/intl/locale/locale_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ PHP_INTL_FUNCTION_WITH_ERROR_RESET(locale_get_keywords)
zend_string_efree( kw_value_str );
}
zend_array_destroy(Z_ARR_P(return_value));
uenum_close( e );
RETURN_FALSE;
}

Expand Down
18 changes: 18 additions & 0 deletions ext/intl/tests/locale_get_keywords_failure.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Locale::getKeywords() closes the keyword enumeration on failure
--EXTENSIONS--
intl
--SKIPIF--
<?php
if (version_compare(INTL_ICU_VERSION, '59.1', '<')) {
die('skip for ICU >= 59.1');
}
?>
--FILE--
<?php
var_dump(Locale::getKeywords('en@foo=bar!'));
var_dump(intl_get_error_code() === U_ILLEGAL_ARGUMENT_ERROR);
?>
--EXPECT--
bool(false)
bool(true)
Loading