WordPress.org

Make WordPress Core

Changeset 38431 for trunk


Ignore:
Timestamp:
08/29/2016 02:58:25 AM (3 years ago)
Author:
dd32
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r38423 r38431  
    10181018
    10191019    if ( ! isset( $ini_all ) ) {
    1020         $ini_all = ini_get_all();
    1021     }
     1020        $ini_all = false;
     1021        // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes".
     1022        if ( function_exists( 'ini_get_all' ) ) {
     1023            $ini_all = ini_get_all();
     1024        }
     1025    }
    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 ) ) ) {
     1029        return true;
     1030    }
     1031
     1032    // If we were unable to retrieve the details, fail gracefully to assume it's changeable.
     1033    if ( ! is_array( $ini_all ) ) {
    10251034        return true;
    10261035    }
Note: See TracChangeset for help on using the changeset viewer.