Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Tags containing special characters created through post editor are not encoding properly #74066

Open ccwalburn opened 1 year ago

ccwalburn commented 1 year ago

Quick summary

RSS feed validator is showing a recommendation that the Category should not contain HTML &#039

The issue is with the creation of tags with apostrophes. We handle categories with apostrophes correctly, but when adding a tag in the post editor, we're not encoding tags correctly.

p1677856012627169-slack-C02DQP0FP

Steps to reproduce

  1. Create a new post
  2. In the right-hand settings panel add a tag with an apostrophe
  3. Visit /settings/taxonomies/post_tag/{SITE_URL} and when you click into that tag you should see the malformed encoding
  4. Run your RSS feed through the RSS feed validator here: https://validator.w3.org/feed/

What you expected to happen

Feed validator to return no errors or recommendations.

What actually happened

Feed validator showed the following recommendation:

rss feed

Impact

All

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

No response

Logs or notes

5990682-zen Note that this ticket triggered this finding but the user's problem in that ticket did not seem to be caused by a tag apostrophes.

github-actions[bot] commented 1 year ago

Support References

This comment is automatically generated. Please do not edit it.

davemart-in commented 1 year ago

I was able to reproduce. Here's what I'm seeing when I add a tag in the editor sidebar:

CleanShot 2023-03-03 at 14 21 40@2x

Then when I go into the tag management screen and click into this tag, the encoded value for the apostrophe can be seen:

CleanShot 2023-03-03 at 14 19 35

cuemarie commented 1 year ago

πŸ“Œ SCRUBBING : RESULT - Replicated / Could Not Replicate / Uncertain

πŸ“Œ FINDINGS/SCREENSHOTS/VIDEO

On my test sites, I published post with the Category It's Me and the Tag You're It. Viewing these new taxonomies appears as follows:

/settings/taxonomies/category/

Screen Shot 2023-03-23 at 3 57 17 PM

/settings/taxonomies/post_tag/

Screen Shot 2023-03-23 at 3 57 32 PM

πŸ“Œ ACTIONS