]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/load.php
WordPress 4.6.1
[autoinstalls/wordpress.git] / wp-includes / load.php
index 11c36fda977063f42d3ba44815fd6630d4cdce18..b69c0d5ea8dbcdc90d376992c4786a6682e01432 100644 (file)
@@ -1017,13 +1017,22 @@ function wp_is_ini_value_changeable( $setting ) {
        static $ini_all;
 
        if ( ! isset( $ini_all ) ) {
        static $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.
        if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
                return true;
        }
 
 
        // 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;
        }
 
+       // 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;
 }