WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12395 closed defect (bug) (fixed)

WP should also catch E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR

Reported by: Denis-de-Bernardy Owned by: westi
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9.2
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:

Description

When writing PHP 5 code, and using the static operator, you can end up with a blank screen in WP. Inheriting a class with a static function and overriding it with a non-static function, for instance, triggers an E_COMPILE or E_CORE (not sure which one exactly), and this leads to a blank screen unless WP_DEBUG is switched on.

The attached patch (it's against 2.9.2, but I take it that it'll apply fine to trunk) adds E_CORE and E_COMPILE to the errors reported by WP.

It also fixes an E_NOTICE when COOKIEHASH is already defined.

Attachments (3)

12395.diff (3.7 KB) - added by Denis-de-Bernardy 7 years ago.
12395.3.diff (3.3 KB) - added by Denis-de-Bernardy 7 years ago.
12395_2.9.diff (3.5 KB) - added by eddieringle 7 years ago.
2.9 backport of 12395.3.diff

Download all attachments as: .zip

Change History (13)

#1 @Denis-de-Bernardy
7 years ago

  • Keywords commit added

#2 @dd32
7 years ago

  • Keywords needs-patch added; has-patch commit removed

broken patch. wp-settings.php & plugins.php do not apply.

#3 @dd32
7 years ago

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

(In [13499]) Display PHP Start-up Errors/Warnings. Props Denis-de-Bernardy. Fixes #12395.

#4 follow-up: @nacin
7 years ago

  • Milestone changed from 3.0 to 2.9.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Suggesting backport to 2.9 branch.

#5 in reply to: ↑ 4 @Denis-de-Bernardy
7 years ago

Replying to nacin:

Suggesting backport to 2.9 branch.

we have a new security hole?

#6 @nacin
7 years ago

  • Keywords has-patch added; needs-patch removed

It's not a security hole, but since there are fatal errors we're declining to report, we can cause annoying white screens of death.

This includes blank iframes when showing a fatal compile error generated by a plugin. This was seen on wp-hackers when a plugin used a function name that was already being used elsewhere. We made another change in [13167] that prevents the error scrape from overriding WP_DEBUG, which would otherwise have shown the compile error.

#7 @eddieringle
7 years ago

  • Cc eddie@… added

Backported to 2.9 in my patch. Haven't been following all the 3.0 changes, but I'm assuming that the error reporting levels that are set in wp-includes/load.php (which is in 3.0 but not 2.9) were moved from wp-settings.php.

@eddieringle
7 years ago

2.9 backport of 12395.3.diff

#8 @nacin
7 years ago

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

(In [14250]) Display PHP start-up errors/warnings. fixes #12395 for 2.9. props eddieringle.

#9 @nacin
7 years ago

  • Milestone 2.9.3 deleted

Milestone 2.9.3 deleted

#10 @nacin
7 years ago

  • Milestone set to 3.0
Note: See TracTickets for help on using tickets.