From 9b2f385b072b0ee3c46490e8c4c18b62c07518ef Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Fri, 8 Jul 2016 18:36:30 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@38017 git-svn-id: http://core.svn.wordpress.org/trunk@37958 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/load.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/load.php b/wp-includes/load.php index 3b79351b97..11c36fda97 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -1020,7 +1020,8 @@ function wp_is_ini_value_changeable( $setting ) { $ini_all = ini_get_all(); } - if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === $ini_all[ $setting ]['access'] || INI_USER === $ini_all[ $setting ]['access'] ) ) { + // 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. + if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) { return true; } diff --git a/wp-includes/version.php b/wp-includes/version.php index f76b5f5e75..6876c7b0f5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta2-38016'; +$wp_version = '4.6-beta2-38017'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.