Make WordPress Core

Opened 8 weeks ago

Last modified 8 weeks ago

#62461 new defect (bug)

If a post has 2 term tags children's and kid+ and from all terms we have children's, kid and kid+, when the post/tags is saved, kid+ is saved as kid

Reported by: frankakot1's profile frankakot1 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.6
Component: Posts, Post Types Keywords: needs-patch changes-requested has-screenshots has-testing-info
Focuses: Cc:

Description

There is an array compare for tags in wp-includes/post.php on line 4989 that will fail comparing the tags because children's will be escape as children\'s and as such the array comparison will be false, thus attaching tags to the post will be qureried by tag name on not buy slug, thus kid+ will be closer to kid, where the slug for kid+ is kid-plus while that for kid is kid.

Change History (1)

#1 @abcd95
8 weeks ago

  • Keywords has-screenshots has-testing-info added

Hey @frankakot1, Welcome to Trac, and thanks for bringing this up.

I was able to reproduce this. Here is the report:

This is a bug specific to WordPress 6.6.x where tags with special characters are incorrectly matched during post save.

Steps to Reproduce:

  1. Install WordPress 6.6
  2. Create three tags:
    • "kid+" (becomes slug: kid-plus)
    • "kid" (becomes slug: kid)
    • "children's" (becomes slug: childrens)
  3. Create a new post
  4. Add tags "kid+" and "children's"
  5. Save post
  6. Check tags - "kid+" becomes "kid"

Expected: The post should keep "kid+" and "children's" tags
Actual: "kid+" is saved as "kid"

However, this has been fixed in the later versions after 6.6.

Screenshots

https://postimg.cc/tZHsNL41
https://postimg.cc/Fdqn6gwJ

Note: See TracTickets for help on using tickets.