WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#11837 closed defect (bug) (fixed)

define('WP_DEBUG', false) generates a silent E_NOTICE

Reported by: nacin Owned by: westi
Milestone: 3.0 Priority: low
Severity: minor Version: 2.9
Component: Warnings/Notices Keywords: has-patch commit
Focuses: Cc:

Description

In wp-settings.php, we're checking if WP_DEBUG is defined and is true. If its not, then we're defining WP_DEBUG as false.

Of course, if WP_DEBUG is defined as false already, then we're generating a silent E_NOTICE (suppressed by the error_reporting initially set in wp-load.php).

Code should check if WP_DEBUG is defined before defining to false.

Attachments (2)

11837.diff (495 bytes) - added by nacin 5 years ago.
11837.2.diff (787 bytes) - added by nacin 5 years ago.
Realized this would be a better way to do it

Download all attachments as: .zip

Change History (4)

@nacin5 years ago

@nacin5 years ago

Realized this would be a better way to do it

comment:1 @hakre5 years ago

Just reviewed the ticket & two patches. +1 for the second approach, think it's worth to fix and ok for commit.

comment:2 @westi5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12685]) Tidy up logic for defining WP_DEBUG so we only define it if it isn't already. Fixes #11837 props nacin.

Note: See TracTickets for help on using tickets.