﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses,prnumber 46813,"wp_die() may generate doing_it_wrong notices, confusing other WP error handling",ohiosierra,SergeyBiryukov,"When wp_die() runs, it checks to see if a more specific die handler should be run. When checking if the XML die handler should run, it calls is_feed(), is_comment_feed(), and is_trackback(). If wp_die() was triggered outside of the loop and WP_DEBUG is enabled, these calls will generate ""doing_it_wrong"" error notices. In other WordPress functions, such as wp_finalize_scraping_edited_file_errors(), WordPress relies on the PHP function, error_get_last() to determine if a fatal error has occurred. Generally if wp_die() has been triggered by an error, the last error will be the one that triggered it. However, if a doing_it_wrong notice has been triggered it will take the place of the fatal error. The net effect is that if WP_DEBUG is enabled, certain protections like the plugin editor rollback feature will not function, because the doing_it_wrong notice hides the fatal error from WordPress. Expected: wp_die() will not trigger any new errors or notices that may obscure an error that caused wp_die() to run.",defect (bug),closed,normal,5.2,Site Health,5.2,normal,fixed,servehappy has-patch has-unit-tests,,,