#46069 closed defect (bug) (fixed)
WP_CONTENT_DIR in wp_register_fatal_error_handler
Reported by: | sebastian.pisula | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.2 | Priority: | normal |
Severity: | normal | Version: | 5.1 |
Component: | Bootstrap/Load | Keywords: | has-patch |
Focuses: | Cc: |
Description
I think this is a problem. My case:
I created file fatal-error-handler.php
in wp-content
directory. In the file I put the code:
<?php class IC_Fatal_Error_Handler extends WP_Fatal_Error_Handler { public function handle() { wp_die( 'error' ); } } return new IC_Fatal_Error_Handler();
And nothing. The file isn't loaded. I think that wp_register_fatal_error_handler()
should be call after calling wp_initial_constants()
Attachments (1)
Change History (7)
#3
@
13 months ago
The conditional check in wp-includes/error-protection.php
will always fail so the drop-in file will never be loaded. It checks for defined( 'WP_CONTENT_DIR' )
which will always be false unless the site owner has explicitly set it in wp-config.php
. This is because the default definition of this constant is later in the lifecycle.
This ticket was mentioned in Slack in #core by diddledan. View the logs.
13 months ago
Note: See
TracTickets for help on using
tickets.
Also reported here: https://core.trac.wordpress.org/ticket/46047#comment:9