[wp-trac] [WordPress Trac] #42085: Still getting ini_get_all warning message

WordPress Trac noreply at wordpress.org
Wed Oct 4 13:18:37 UTC 2017


#42085: Still getting ini_get_all warning message
--------------------------+-----------------------------
 Reporter:  scottcwilson  |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.8.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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();
       }
     }
   }

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42085>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list