Make WordPress Core

Ticket #37680: 37680.diff

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

    function wp_convert_hr_to_bytes( $value  
    10021002        // Deal with large (float) values which run into the maximum integer size.
    10031003        return min( $bytes, PHP_INT_MAX );
    10041004}
    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 ) {
    1017         static $ini_all;
     1017        static $ini_all = false;
    10181018
    1019         if ( ! isset( $ini_all ) ) {
    1020                 $ini_all = ini_get_all();
     1019        if ( false === $ini_all ) {
     1020                $ini_all = @ini_get_all();
    10211021        }
    10221022
    10231023        // 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.
    10241024        if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) {
    10251025                return true;
    10261026        }
    10271027
     1028        // If we were unable to retrieve the details, fail gracefully to assume it's changeable.
     1029        if ( ! is_array( $ini_all ) ) {
     1030                return true;
     1031        }
     1032
    10281033        return false;
    10291034}