Make WordPress Core

Ticket #37680: 37680.2.diff

File 37680.2.diff, 1.3 KB (added by dd32, 8 years ago)
  • src/wp-includes/load.php

    function wp_convert_hr_to_bytes( $value  
    10051005
    10061006/**
    10071007 * Determines whether a PHP ini value is changeable at runtime.
    10081008 *
    10091009 * @since 4.6.0
    10101010 *
    10111011 * @link https://secure.php.net/manual/en/function.ini-get-all.php
    10121012 *
    10131013 * @param string $setting The name of the ini setting to check.
    10141014 * @return bool True if the value is changeable at runtime. False otherwise.
    10151015 */
    10161016function wp_is_ini_value_changeable( $setting ) {
    10171017        static $ini_all;
    10181018
    10191019        if ( ! isset( $ini_all ) ) {
    1020                 $ini_all = ini_get_all();
     1020                if ( false !== strpos( ini_get( 'disable_functions' ), 'ini_get_all' ) ) {
     1021                        $ini_all = false;
     1022                } else {
     1023                        $ini_all = ini_get_all();
     1024                }
    10211025        }
    10221026
    10231027        // 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.
    10241028        if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
    10251029                return true;
    10261030        }
    10271031
     1032        // If we were unable to retrieve the details, fail gracefully to assume it's changeable.
     1033        if ( ! is_array( $ini_all ) ) {
     1034                return true;
     1035        }
     1036
    10281037        return false;
    10291038}