WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 6 weeks ago

#45378 closed defect (bug) (fixed)

Convert soft hyphens when sanitizing titles

Reported by: andg Owned by: pento
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Formatting Keywords: needs-patch needs-unit-tests
Focuses: Cc:

Description

When copying and pasting titles from a different website, sometimes soft hyphens are included in the copied text. Unfortunately, the sanitize_title_with_dashes function doesn't take care of this eventuality, since it doesn't convert %c2%ad instances to empty strings.

In our client's installation, this led to slugs not being generated correctly, making those posts inaccessible.

Attachments (1)

45378.diff (439 bytes) - added by andg 2 months ago.
Convert soft hyphens to empty string.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
3 months ago

  • Component changed from General to Formatting
  • Keywords needs-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 5.1
  • Owner set to SergeyBiryukov
  • Status changed from new to accepted

@andg
2 months ago

Convert soft hyphens to empty string.

#2 @pento
6 weeks ago

  • Owner changed from SergeyBiryukov to pento
  • Status changed from accepted to assigned

#3 @pento
6 weeks ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 44579:

Formatting: Remove soft hyphens when sanitising titles.

Props andg.
Fixes #45378.

Note: See TracTickets for help on using tickets.