Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45378 closed defect (bug) (fixed)

Convert soft hyphens when sanitizing titles

Reported by: andg's profile andg Owned by: pento's profile 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 6 years ago.
Convert soft hyphens to empty string.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
6 years 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
6 years ago

Convert soft hyphens to empty string.

#2 @pento
6 years ago

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

#3 @pento
6 years 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.