Skip to content

Commit 78789be

Browse files
committed
Bootstrap: Make wp_is_ini_value_changeable() compatible with PHP 5.2.6 - 5.2.17.
There is a bug in PHP 5.2.6 - 5.2.17 (https://bugs.php.net/bug.php?id=44936, https://3v4l.org/IL0A2) which changes the access level of a setting to 63 after `ini_set()` was called. To continue comparing the access value against `INI_ALL` and `INI_USER` use the bit operator `& 7`: * `1 & 7 === 1` (INI_USER) * `2 & 7 === 2` (INI_PERDIR) * `4 & 7 === 4` (INI_SYSTEM) * `7 & 7 === 7` (INI_ALL) * `63 & 7 === 7` (INI_ALL) See [38015]. See #32075. git-svn-id: https://develop.svn.wordpress.org/trunk@38017 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a927a48 commit 78789be

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/wp-includes/load.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,8 @@ function wp_is_ini_value_changeable( $setting ) {
10201020
$ini_all = ini_get_all();
10211021
}
10221022

1023-
if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === $ini_all[ $setting ]['access'] || INI_USER === $ini_all[ $setting ]['access'] ) ) {
1023+
// Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
1024+
if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
10241025
return true;
10251026
}
10261027

0 commit comments

Comments
 (0)