Opened 6 years ago
Closed 6 years ago
#43815 closed defect (bug) (fixed)
Text Widget: Warnings thrown when using invalid HTML in legacy mode
Reported by: | jeherve | Owned by: | pento |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | 4.9 |
Component: | Widgets | Keywords: | has-patch |
Focuses: | Cc: |
Description
Steps to reproduce the issue
- Start with a site running WP 4.7.10.
- Add a new Text Widget to your site with the following contents:
<img src="http://example.com/img.jpg" border="0" title="Example" /></a>
- Update to WP 4.9.5
- Notice the widget still there under Appearance > Widgets.
- Load your site's front end.
- In your logs, you should see the following warning:
[Suppressed] Warning: DOMDocument::loadHTML(): Unexpected end tag : a in Entity, line: 1 in /home/wpcom/public_html/wp-includes/widgets/class-wp-widget-text.php on line 129
This seems to happen because of the invalid HTML in the widget.
In #41622 and r41251, we suppressed those warnings. Unfortunately invalid HTML can still fill in logs. I think it would be nice if we could get rid of those warnings, with the attached patch.
Let me know what you think about this!
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Text Widget: suppress all warnings thrown when using invalid HTML in legacy mode