#46069 closed defect (bug) (fixed)
WP_CONTENT_DIR in wp_register_fatal_error_handler
| Reported by: | sebastian.pisula | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.2 |
| Component: | Bootstrap/Load | Version: | 5.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
8 years 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Also reported here: https://core.trac.wordpress.org/ticket/46047#comment:9