Make WordPress Core

Changeset 38460


Ignore:
Timestamp:
08/31/2016 06:05:06 AM (8 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".

Merges [38431] to the 4.6 branch.
Fixes #37680.

Location:
branches/4.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6

  • branches/4.6/src/wp-includes/load.php

    r38017 r38460  
    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.
     
    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}
Note: See TracChangeset for help on using the changeset viewer.