[wp-trac] [WordPress Trac] #30419: Taxonomy tags with '&' in name and modified slug are not assignable anymore.
WordPress Trac
noreply at wordpress.org
Thu Nov 20 16:00:10 UTC 2014
#30419: Taxonomy tags with '&' in name and modified slug are not assignable
anymore.
--------------------------+-----------------------------
Reporter: pavelic | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 4.0
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Steps to reproduce:
* Start with a clean WP install.
* Go to Posts -> Tags
* Create a tag with & in name. Example: "Test & test"
* Edit the newly created tags slug. Default: "test-test" Replacement:
"test-and-test"
* Go to the default "Hello world post"
* go to tags, type in "Test" until you get the dropdown option, select it,
press add and press update on post
* refresh page just in case and marvel at the lack of the tag being
assigned to the post.
From what i could trace, the failing spot is the SQL query in wp-
includes\taxonomy.php, term_exists().
Where the query looks something like:
{{{#!sql
SELECT tt.term_id, tt.term_taxonomy_id
FROM wp_terms AS t
INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id
WHERE t.name = 'Test & test' AND tt.taxonomy = 'post_tag'
}}}
While the value actually stored in the "name" field in the wp_terms table
is "Test & test".
Also, if its not obvious, it does not trigger on unchanged slug, because
if the slug is unchanged it matches first on the one generated from WP.
Poke me for extra info if required.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30419>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list