[wp-trac] [WordPress Trac] #47580: Prevent output of invalid HTML in `_default_wp_die_handler()`
WordPress Trac
noreply at wordpress.org
Fri Jul 26 15:10:46 UTC 2019
#47580: Prevent output of invalid HTML in `_default_wp_die_handler()`
----------------------------+-----------------------------
Reporter: jeremyfelt | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: accessibility
----------------------------+-----------------------------
Comment (by SergeyBiryukov):
Replying to [ticket:47580 jeremyfelt]:
> `wp_die()` already has `$args` that are passed to the handlers. It seems
like we could add key there for whether the handler should wrap in its own
HTML or display the message as is.
A key in `$args` might be cleaner, but also seems a bit like an overkill.
Maybe a simple `strpos( $message, '<p>' )` check before adding the `<p>`
tag would suffice here?
Another option suggested by @audrasjb is to use `<div>` instead of `<p>`
to allow for nested elements.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47580#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list