mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-26 22:32:52 +02:00
Bootstrap: Check that ini_get_all()
exists before calling it, allows us to work around hosts who disable the function for "security purposes".
Fixes #37680 for trunk. Built from https://develop.svn.wordpress.org/trunk@38431 git-svn-id: http://core.svn.wordpress.org/trunk@38372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
30270d851f
commit
56bc1dc194
@ -1017,14 +1017,23 @@ function wp_is_ini_value_changeable( $setting ) {
|
|||||||
static $ini_all;
|
static $ini_all;
|
||||||
|
|
||||||
if ( ! isset( $ini_all ) ) {
|
if ( ! isset( $ini_all ) ) {
|
||||||
$ini_all = ini_get_all();
|
$ini_all = false;
|
||||||
}
|
// Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes".
|
||||||
|
if ( function_exists( 'ini_get_all' ) ) {
|
||||||
|
$ini_all = ini_get_all();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 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.
|
// 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 ) ) ) {
|
if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If we were unable to retrieve the details, fail gracefully to assume it's changeable.
|
||||||
|
if ( ! is_array( $ini_all ) ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38430';
|
$wp_version = '4.7-alpha-38431';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user