Not escaping singles quotes (‘) in images “Alt” attributes
-
Hi,
I’m using a plugin that dynamically find and replace some specific words in my content. This plugin was doing some weird things on the Download Manager pages (breaking some elements), until I noticed that the single quotes (‘) were not correctly escaped in the image ALT attributes of the featured images in the table/category listings.
Here is an example of bad DM HTML output (look at the Alt attribute):
<img class="wpdm-thumb wpdm-thumb-96x96 wpdm-thumb-41" src="https://example.com/wp-content/uploads/wpdm-cache/xyz.png" alt="Police d" écriture="" cursive="" (suisse="" romande)'="">
The package name was:
Police d'écriture cursive (France)
(containing a straight single quote “‘” in its title). As you can see, the ALT attribute is messed up. And this causes a big problem in my setting.
How to replicate the problem:
- Create a new package with a single quote in its title (straight single quote instead of curly quote)
Example:
That’s not fun - Set a featured image for this package.
- Publish.
- Check the result in the package listings (for example using the block editor “List packages”). The ALT attribute of the thumbnail (featured image) is messed up.
Would it be possible to fix this? I’m willing to buy the PRO version, but this issue breaks my page.
- Create a new package with a single quote in its title (straight single quote instead of curly quote)
- The topic ‘Not escaping singles quotes (‘) in images “Alt” attributes’ is closed to new replies.