Bug: Title attribute not properly escaped
-
I was looking through the markup on my site when I noticed this widget was outputing invalid HTML for posts whose title contains characters like
"
(quotation marks), for instance<a href="<url>" title="The Final 1 Champion Farisha Ishak: "When I Hugged My Family, The Tears Came"">
This breaks the title attribute, although the widget still displays fine (because modern browser HTML parsers are not picky).
I noticed that on line 1126 of wordpress-popularposts.php the developer used
htmlspecialchars
, but that wouldn’t be enough because the$title
is displayed as an attribute and not as content between HTML tags.esc_attr
should be used insteadhttps://www.ads-software.com/plugins/wordpress-popular-posts/
- The topic ‘Bug: Title attribute not properly escaped’ is closed to new replies.