Opened 7 years ago
Last modified 5 years ago
#47413 reviewing defect (bug)
nested paragraphs in comment post errors
| Reported by: | tnbnicer | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Comments | Version: | 4.5 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Line 30 in ‘wordpress/wp-comments-post.php’:
<?php '<p>' . $comment->get_error_message() . '</p>'
An example of the Html code generated:
<p><p><strong>ERROR</strong>: please fill the required fields (name, email).</p></p>
The reason is that in function _default_wp_die_handler, line 3072 in ‘wordpress/wp-includes/functions.php’ (WordPress 5.2.1), there already is a paragraph tag.
<?php $message = "<p>$message</p>"
I would suggest removing the paragraph in ‘wp-comments-post.php’. Simply:
<?php $comment->get_error_message()
ought to do.
Attachments (1)
Change History (7)
#2
@
7 years ago
Thanks. The fix works for me. To be honest, I removed the tags in my source in release 5.1.1 some weeks ago. I noticed them again while updating to 5.2.1 yesterday. Good.
#3
@
7 years ago
- Milestone Awaiting Review → 5.3
- Owner set to
- Status new → reviewing
- Version 5.2.1 → 4.5
#4
@
7 years ago
- Milestone 5.3 → Future Release
The latest patch still applies cleanly, but this ticket hasn't seen any movement this cycle. With 5.3 RC1 approaching, this is being moved to Future Release. @jeremyfelt if you feel strongly about this one being in 5.3, it can be moved back up.
#5
@
7 years ago
A "complex" error message is valid:
<h1>You need a higher level of permission.</h1><p>Sorry, you are not allowed to manage terms in this taxonomy.</p>
while:
<p><h1>You need a higher level of permission.</h1><p>Sorry, you are not allowed to manage terms in this taxonomy.</p></p>
is not.
@davidbaumwald. I only occasionally look at WP code, so speaking as a lay person, I wonder whether leaving it for Future Release is sensible. There is nested html code. Still in 5.2.3. Removing the extra <p></p> tags from ‘wp-comments-post.php’ corrects the nested html. The changes proposed in [45909] are neither ruled out in future nor required now to fix the problem, but incorrect tags ought to be removed.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Make sense