Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#34555 new defect (bug)

superscript in url

Reported by: sabrisahincan's profile sabrisahincan Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: 2nd-opinion
Focuses: Cc:

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 9 years ago.
Superscript in URL

Download all attachments as: .zip

Change History (8)

@GaryJ
9 years ago

Superscript in URL

#1 @GaryJ
9 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
9 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
9 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
9 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
9 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
9 years ago

  • Keywords close removed

#7 @SergeyBiryukov
9 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.