Skip to content
Open
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
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ PHP NEWS
rmdir(), touch(), chmod() or stat(). (Ilia Alshanetsky)

- Standard:
. Made extension names in ini_get_all() case-insensitive. (Weilin Du)
. Fixed bug GH-25387 (Uploaded files leak in request_parse_body()).
(Kévin Dunglas)
. Fixed quoted_printable_decode() truncating input at NUL bytes. (Weilin Du)
Expand Down
5 changes: 5 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ PHP 8.7 UPGRADE NOTES
application terminate one attribute and append further ones.

- Standard:
. ini_get_all() now matches extension names case-insensitively using ASCII
rules, independently of the current locale. Names that differ only in
capitalization from a loaded extension now succeed instead of emitting a
warning and returning false.
RFC: https://wiki.php.net/rfc/case_insensitive_ini_get_all
. bindec(), octdec(), hexdec() and base_convert() now throw an Exception
when the passed string contains characters that are invalid for the
specified number base.
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/basic_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ PHP_FUNCTION(ini_get_all)
zend_ini_sort_entries();

if (extname) {
if ((module = zend_hash_find_ptr(&module_registry, extname)) == NULL) {
if ((module = zend_hash_find_ptr_lc(&module_registry, extname)) == NULL) {
php_error_docref(NULL, E_WARNING, "Extension \"%pS\" cannot be found", extname);
RETURN_FALSE;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--TEST--
ini_get_all() accepts case-insensitive extension names
--FILE--
<?php
foreach (['PCRE', 'Pcre', 'pCrE'] as $extension) {
var_dump(ini_get_all($extension) === ini_get_all('pcre'));
var_dump(ini_get_all($extension, true) === ini_get_all('pcre', true));
var_dump(ini_get_all($extension, false) === ini_get_all('pcre', false));
}

var_dump(ini_get_all('REFLECTION'));
var_dump(ini_get_all('Reflection', false));

var_dump(ini_get_all('NoSuchExtension'));
var_dump(ini_get_all('NoSuchExtension', false));
?>
--EXPECTF--
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
array(0) {
}
array(0) {
}

Warning: ini_get_all(): Extension "NoSuchExtension" cannot be found in %s on line %d
bool(false)

Warning: ini_get_all(): Extension "NoSuchExtension" cannot be found in %s on line %d
bool(false)
Loading