[wp-trac] [WordPress Trac] #31328: Emoji in a slug fails to display
WordPress Trac
noreply at wordpress.org
Tue Mar 10 14:17:43 UTC 2015
#31328: Emoji in a slug fails to display
----------------------------------------+-----------------------------
Reporter: kraftbj | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.2
Component: Formatting | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: administration
----------------------------------------+-----------------------------
Comment (by boonebgorges):
Replying to [comment:8 pento]:
> [attachment:31328.3.diff] fixes this by adding `$` as an allowed
character in `sanitize_title_with_dashes()`. I also changed a couple of
unit tests, because I don't know why the term insertion was expected to
fail.
>
> @boone, @SergeyBiryukov, @wonderboymusic: Could you please have a look
at this patch and tell me what I'm missing?
Those tests fail by design. The idea is that you should not be able to
create terms with the same 'name' in the same taxonomy. That's what #17689
is all about.
That being said, I do think it's correct to roll back [28733]. That fix
was perhaps appropriate for the way that `wp_insert_term()` used to work,
but since 4.1, I'm not sure it makes sense anymore. The bug in #17689 was
that certain duplicate-name checks were failing because of the way that
term names with weird characters sanitize into term slugs. But if all
we're worried about is duplicate names, then we should not be checking
slugs at all. See [attachment:31328.4.diff]. This also lets us leave
`sanitize_title_with_dashes()` alone - the addition of `$` to the regex
there seems arbitrary and is utterly terrifying.
See #31270 and #30379 for related discussion. My suggested change looks
like it would fix both of those tickets, though we'd need tests to verify
that.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31328#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list