Make WordPress Core

Opened 16 months ago

Last modified 4 weeks ago

#47912 accepted defect (bug)

Non-visible chars in title creates some encoded values in permalink

Reported by: dhanendran Owned by: SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: major Version: 5.2.2
Component: Permalinks Keywords: has-patch has-unit-tests needs-testing
Focuses: ui, rtl, administration Cc:


When someone copy past some values from word documents, some other editor or some site on the web, we end-up copying some non visible chars and pasting it in the WordPress post title. This creates some encoded values in the permalink.

[In this link|https://www.utf8-chartable.de/unicode-utf8-table.pl?start=8192&number=128] there are so many non visible characters which can be easily added in to the post title. There are other examples as well for this issue one of them is [Byte Order Mark|https://en.wikipedia.org/wiki/Byte_order_mark].

sanitize_title() function only removes the accents from the title not these kind of characters.

I have searched all the open tickets in trac and couldn't find anything related to this issue, so opening one.

Attachments (1)

47912.diff (1.4 KB) - added by dhanendran 16 months ago.
added patch and unit test

Download all attachments as: .zip

Change History (16)

#1 @SergeyBiryukov
16 months ago

  • Milestone changed from Awaiting Review to 5.3
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

Hi @dhanendran, welcome to WordPress Trac! Thanks for the report.

sanitize_title() indeed does not remove this kind of characters, but sanitize_title_with_dashes() does.

Looks like we need to add some more characters there.

#2 @SergeyBiryukov
16 months ago

  • Keywords needs-patch needs-unit-tests added

#3 @SergeyBiryukov
16 months ago

The characters are generally added on a case-by-case basis, not all at once.

Let's start with these two here:

16 months ago

added patch and unit test

#4 @dhanendran
16 months ago

  • Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed

@sergeybiryukov I have added the patch with unit test.

Last edited 16 months ago by dhanendran (previous) (diff)

This ticket was mentioned in Slack in #core by marybaum. View the logs.

14 months ago

#7 @garrett-eclipse
14 months ago

  • Keywords needs-testing added

@SergeyBiryukov will you have time to review for 5.3?

#8 @SergeyBiryukov
14 months ago

  • Milestone changed from 5.3 to 5.4

#9 @audrasjb
10 months ago

  • Milestone changed from 5.4 to Future Release


With 5.4 Beta 3 approaching and the Beta period reserved for bugs introduced during the cycle, this is being moved to Future Release. If any maintainer or committer feels this should be included or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

#11 @SergeyBiryukov
9 months ago

  • Milestone changed from Future Release to 5.5

#12 @earnjam
5 months ago

@SergeyBiryukov You milestoned this for 5.5. Is it on your list before the beta, or do you want to punt?

#13 @SergeyBiryukov
5 months ago

  • Milestone changed from 5.5 to 5.6

#15 @helen
4 weeks ago

  • Milestone changed from 5.6 to 5.7

Moving to 5.7 to go with #50924 and #47594.

Note: See TracTickets for help on using tickets.