Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#42085 new defect (bug)

Still getting ini_get_all warning message — at Version 1

Reported by: scottcwilson's profile scottcwilson Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Bootstrap/Load Keywords: needs-patch 2nd-opinion
Focuses: Cc:

Description (last modified by SergeyBiryukov)

For some PHP configurations, the check function_exists does not suffice.

Warning: ini_get_all() has been disabled for security reasons in /home/mysite/public_html/wp-includes/load.php on line 1027

Suggested fix in wp_is_ini_value_changeable()

  if ( ! isset( $ini_all ) ) {
    $ini_all = false;
    // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes".
    if ( function_exists( 'ini_get_all' ) ) {
      $disabled_functions_raw = explode( ',', ini_get( 'disable_functions' ) );
      $disabled_functions = array_map( 'trim', $disabled_functions_raw );
      if (!array_search( 'ini_get_all', $disabled_functions ) ) {
        $ini_all = ini_get_all();
      }
    }
  }

Change History (1)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Bootstrap/Load
  • Description modified (diff)

Previously: #37680

Note: See TracTickets for help on using tickets.