WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#34555 new defect (bug)

superscript in url

Reported by: sabrisahincan Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: 2nd-opinion
Focuses: Cc:
PR Number:

Description

If you have a superscript in the post title and selected post-name structure for permalink, it creates a slug as in the image: http://prntscr.com/8y3wsc

Attachments (1)

superscript-url.png (13.4 KB) - added by GaryJ 4 years ago.
Superscript in URL

Download all attachments as: .zip

Change History (8)

@GaryJ
4 years ago

Superscript in URL

#1 @GaryJ
4 years ago

Welcome to Trac sabrisahincan. Thank you for your report.

I've added your screenshot as an attachment here, in case the linked version is ever deleted.

#2 @johnbillion
4 years ago

  • Keywords close 2nd-opinion added
  • Version 4.2.4 deleted

This isn't specific to superscript characters. The majority of printable non-ASCII characters will appear in a post's slug if it's entered into the post title.

See sanitize_title_with_dashes() for where this behaviour is defined (and note that its description isn't very accurate when it comes to multibyte characters).

Do superscript and subscript characters actually cause a problem when they appear in a post permalink?

#3 @pento
4 years ago

I'm in two minds about this.

On the one hand, they're valid URLs, and it's not practical for us to take care of every printable character (especially now that we support multibyte characters in the URL).

On the other hand, I can't even type that character on my phone keyboard, so it wouldn't be possible for me to visit the page directly. As far as practicality goes, we could potentially take care of the most common cases (which we already do), and add in other cases as they're reported (such as in this ticket).

#4 @sabrisahincan
4 years ago

This problem occured on a website which served on a windows server. It gave a 404 error when I try to navigate to permalink. Today I tested on a linux server and it worked. I dont know the exact specifications of servers but it might be caused by configuration of IIS on windows machine.

#5 @swissspidy
4 years ago

As far as practicality goes, we could potentially take care of the most common cases (which we already do), and add in other cases as they're reported (such as in this ticket).

+1 for this.

#6 @swissspidy
4 years ago

  • Keywords close removed

#7 @SergeyBiryukov
4 years ago

I think this is fine as is. Should we convert superscript numbers in slugs to regular numbers or just remove them? Both options seem confusing.

Per comment:4, this was an IIS configuration issue, and any multibyte character, including non-Latin alphabets, would have the same issue.

Note: See TracTickets for help on using tickets.