[wp-trac] [WordPress Trac] #46813: wp_die() may generate doing_it_wrong notices, confusing other WP error handling

WordPress Trac noreply at wordpress.org
Sun Apr 14 04:34:57 UTC 2019


#46813: wp_die() may generate doing_it_wrong notices, confusing other WP error
handling
-------------------------------------------------+---------------------
 Reporter:  ohiosierra                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.2
Component:  Bootstrap/Load                       |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  servehappy has-patch has-unit-tests  |     Focuses:
-------------------------------------------------+---------------------

Comment (by TimothyBlynJacobs):

 I don't think it is cleaner code because it is still causing the notices,
 the output is just suppressed. The `doing_it_wrong_run` action will still
 fire, for instance. Suppressing it by adding a filter also doesn't
 guarantee the output will not appear, other filters may cause the output
 to still echo. The cleanest would be making sure core code doesn't cause
 `_doing_it_wrong` to be called at all IMO, which is why I personally
 prefer your initial patch.

 I think making the error scraping code more resilient to other errors in
 the shutdown process should be explored, but I don't think it is necessary
 to solve this ticket and needs more research. Applying it globally to
 `wp_die()` is both not targeted enough ( wp_die() is called far more often
 in non-error scraping contexts ) and not broad enough to catch the various
 ways in which the last error can be polluted ( just in core we have doing
 it wrongs, and all the deprecated triggers ).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46813#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list