WordPress.org

Make WordPress Core

Opened 11 months ago

Closed 3 months ago

#24325 closed enhancement (wontfix)

[wp-includes/load.php] LINE 270: ini_set should be verify before call

Reported by: teo.cojo Owned by: nacin
Milestone: Priority: normal
Severity: minor Version:
Component: General Keywords:
Focuses: Cc:

Description

Block @2 should be encapsulate in @1 if.

Most of hosting disable ini_set function and this will resolve some users frustration about multiple junk line of logs or error display.

This is my first report, so I apologize if something is wrong.

@1

if (function_exists('ini_set')) {
 @2 CODE
}

@2

if ( WP_DEBUG_DISPLAY )
   ini_set( 'display_errors', 1 );
elseif ( null !== WP_DEBUG_DISPLAY )
   ini_set( 'display_errors', 0 );

if ( WP_DEBUG_LOG ) {
   ini_set( 'log_errors', 1 );
   ini_set( 'error_log', WP_CONTENT_DIR . '/debug.log' );
}

Change History (3)

comment:1 SergeyBiryukov11 months ago

  • Keywords has-patch removed

Looks like most of other instances in core use error suppression: @ini_set(...).

Not sure if that would make sense here though. These are the ones that only run with WP_DEBUG on, so if ini_set() is disabled, hiding that fact would make debugging harder.

comment:2 nacin3 months ago

  • Owner set to nacin
  • Status changed from new to reviewing

I agree with Sergey here — we shouldn't hide these errors because they are within debugging blocks.

comment:3 nacin3 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from reviewing to closed

Meant to close this.

Note: See TracTickets for help on using tickets.