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

WordPress Trac noreply at wordpress.org
Wed Oct 4 13:25:08 UTC 2017


#42085: Still getting ini_get_all warning message
----------------------------+------------------------------
 Reporter:  scottcwilson    |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Bootstrap/Load  |     Version:  4.8.2
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------
Changes (by SergeyBiryukov):

 * component:  General => Bootstrap/Load


Old description:

> 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();
>       }
>     }
>   }

New description:

 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();
       }
     }
   }
 }}}

--

Comment:

 Previously: #37680

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


More information about the wp-trac mailing list