[wp-trac] [WordPress Trac] #14490: function "get cat ID" fails if category name has an apostrophe
WordPress Trac
noreply at wordpress.org
Sun Oct 23 16:38:32 UTC 2016
#14490: function "get cat ID" fails if category name has an apostrophe
-------------------------------+-----------------------
Reporter: iamronen | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone:
Component: Taxonomy | Version: 3.1
Severity: minor | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+-----------------------
Comment (by jackreichert):
I'm wondering if this has to do with database collation. I was not able to
reproduce this with database set to utf8mb4_unicode.
Categories I tried with:
` echo get_cat_ID( "Jack’s cat" ); # using single comma quotation
mark
echo get_cat_ID( "Someone's cat" ); # using apostrophe
echo get_cat_ID( "“I like spaghetti”" ); # using left and right
double turned comma quotation mark
echo get_cat_ID( "˓ Modifier Letter Centered Left Half Ring" ); #
using modifier letter centered left half ring `
One thing I noticed was that the apostrophe was being translated to a
single comma quotation mark here `/wp-admin/edit-
tags.php?taxonomy=category`. If I called it with get_cat_ID as a single
comma quotation mark it came back 0 but if I called it as an apostrophe
(what I had set it up as) it was fine.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/14490#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list