WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#9639 closed enhancement (fixed)

Error Reporting for Wp-load.php overrides E_DEPRECATED too late

Reported by: jacobsantos Owned by:
Milestone: 2.8 Priority: low
Severity: minor Version: 2.7
Component: Warnings/Notices Keywords: has-patch tested commit
Focuses: Cc:

Description

There is a problem with the wp-load.php for the administration where the bootstrap is not setting the E_DEPRECATED and thus you get some notices about deprecation before wp-settings.php overrides the error reporting and stops it any further.

This is a strange error and might have to be with RC2-dev PHP version of PHP5.3.0. However, I am sending it here, just in case it is run-time verses compile-time settings (does not appear to be since moving the E_DEPRECATED outside the if branch, does not remove the warnings.

The strange-ness of the notices is that the notices are in wp-settings.php lines 520+, whereas the error reporting is set in lines 220. There shouldn't be any notices displayed since the error reporting in lines 220 should prevent the notices from showing in 520.

Attachments (3)

9639.diff (773 bytes) - added by jacobsantos 5 years ago.
Fix PHP deprecated notices based off of 2.7.1 tag.
correct_error_reporting.diff (451 bytes) - added by jacobsantos 5 years ago.
Better fix, with just displaying the errors we want.
8701.diff (1.6 KB) - added by Denis-de-Bernardy 5 years ago.
corrected patch

Download all attachments as: .zip

Change History (13)

jacobsantos5 years ago

Fix PHP deprecated notices based off of 2.7.1 tag.

comment:1 jacobsantos5 years ago

Patch should apply to trunk as well. Let me know and I'll create another patch for trunk.

comment:2 Denis-de-Bernardy5 years ago

Just checking... is this a dup of #8701, or a something specific to 2.7.1 (which will probably never be fixed).

comment:3 follow-up: azaozz5 years ago

Yes, it's similar to #8701. However do we need all of these on a production install:

1  	E_ERROR
2 	E_WARNING
4 	E_PARSE
16 	E_CORE_ERROR
32 	E_CORE_WARNING
64 	E_COMPILE_ERROR
128 	E_COMPILE_WARNING
256 	E_USER_ERROR
512 	E_USER_WARNING

Or perhaps we can stick to basic error reporting only:

error_reporting(E_ERROR | E_WARNING | E_PARSE);

Also if we need the long list, why are we "Xor" ^ E_STRICT when we should be tuning it off "And Not" & ~E_STRICT as proposed by westi. That makes the test for PHP 6.x redundant.

comment:4 jacobsantos5 years ago

It is basically the same as #8701 (why is that still open when it is fixed?) but for wp-load.php.

@azaozz That would work as well. A whitelist is starting to be less work and options than a blacklist.

comment:5 in reply to: ↑ 3 jacobsantos5 years ago

Replying to azaozz:

Also if we need the long list, why are we "Xor" ^ E_STRICT when we should be tuning it off "And Not" & ~E_STRICT as proposed by westi. That makes the test for PHP 6.x redundant.

In my tests, basically ^ E_STRICT works the same as | ~E_STRICT and same for the others.

jacobsantos5 years ago

Better fix, with just displaying the errors we want.

comment:6 jacobsantos5 years ago

New error reporting replaces the tests and just displays the errors that we want to see.

Denis-de-Bernardy5 years ago

corrected patch

comment:8 jacobsantos5 years ago

  • Keywords commit added

Meh, Denis's patch will fix the other ticket as well. Please commit, this is actually quite annoying for those on PHP5.3.0rc.

comment:9 jacobsantos5 years ago

By that, I mean it is annoying to me and maybe one or two others.

comment:10 ryan5 years ago

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

(In [11128]) Error reporting fixes. Props Denis-de-Bernardy, jacobsantos. fixes #9639 #8701

Note: See TracTickets for help on using tickets.