Opened 6 years ago
Last modified 7 months ago
#47266 new defect (bug)
Template of shutdown handler for fatal errors should not be displayed for CLI scripts
Reported by: | iandunn | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.2 |
Component: | Site Health | Keywords: | servehappy has-patch |
Focuses: | Cc: |
Description (last modified by )
When running a CLI script that has a syntax error, the template's raw HTML and CSS are output to the command line.
I don't think that the shutdown handler for fatal errors should be loaded in a CLI context; instead, the default PHP behavior should be used instead.
This should handle the case where the CLI script is being run through WP-CLI, and also older scripts that were built before WP-CLI existed, which just load WP manually (i.e., check 'cli' === php_sapi_name()
rather than defined( 'WP_CLI' )
).
Change History (8)
#1
follow-up:
↓ 2
@
6 years ago
- Description modified (diff)
- Keywords servehappy added; site-health removed
- Summary changed from Site health template should not be displayed for CLI scripts to Template of shutdown handler for fatal errors should not be displayed for CLI scripts
This ticket was mentioned in Slack in #core-php by spacedmonkey. View the logs.
6 years ago
This ticket was mentioned in PR #6337 on WordPress/wordpress-develop by @kkmuffme.
9 months ago
#6
- Keywords has-patch added; needs-patch removed
Trac ticket: https://core.trac.wordpress.org/ticket/47266
An alternative would be to add a
wp_die
handler for CLI context.