WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#7035 closed enhancement (fixed)

Error Reporting should use E_* constants and bitmasks, not numbers for clarity

Reported by: jacobsantos Owned by: pishmishy
Milestone: 2.7 Priority: lowest
Severity: trivial Version:
Component: General Keywords: wp-mail has-patch
Focuses: Cc:

Description

error_reporting(2037); in wp-mail.php on line 5.

Is not a defined constant as listed at Error Reporting php.net page.

What is this supposed to be? It should be changed to either the constant it should be or the bit mask that it evaluates to that number.

This will help future developers understand the intention of the original author in order to prevent another developer from "correcting the mistake."

Attachments (2)

7035.patch (643 bytes) - added by pishmishy 6 years ago.
7035.r8483.diff (426 bytes) - added by jacobsantos 6 years ago.
Remove error reporting from wp-mail.php based off of r8483

Download all attachments as: .zip

Change History (11)

comment:1 pishmishy6 years ago

  • Owner changed from anonymous to pishmishy
  • Status changed from new to assigned

2037 = 1 + 4 +16 +32 + 64 + 128 +256 +512 +1024

E_ERROR | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE

pishmishy6 years ago

comment:2 pishmishy6 years ago

  • Keywords has-patch added

comment:3 santosj6 years ago

This should probably go in soon.

comment:4 ryan6 years ago

Can we just get rid of that line and let the error reporting levels set in wp-settings apply?

comment:5 jacobsantos6 years ago

Yeah, that would work too.

jacobsantos6 years ago

Remove error reporting from wp-mail.php based off of r8483

comment:6 follow-up: jacobsantos6 years ago

Question: Was I the one that made that comment? That does sound like something I would write.

comment:7 in reply to: ↑ 6 DD326 years ago

Replying to jacobsantos:

Question: Was I the one that made that comment? That does sound like something I would write.

You indeed did: http://trac.wordpress.org/changeset/7991#file11

comment:8 jacobsantos6 years ago

In retrospect, I was pretty much an asshole making that comment. WTF? I made this ticket!

comment:9 westi6 years ago

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

(In [8488]) Remove setting of error_reporting and just use the default WordPress error_reporting settings. Fixes #7035 props jacobsantos.

Note: See TracTickets for help on using tickets.