WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#16496 new enhancement

Make $sample_permalink_html human-readable on Edit Post screen

Reported by: linuxologos Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

If the permalink contains words with non-latin characters (for example the permalink structure is /%category%/%postname%/ and the assigned category is non-English) the $sample_permalink_html, which is echoed by edit-form-advanced.php, is not human readable on Edit Post screen (below the title). The editable part of the permalink (the one that comes from the title of the post) is readable.

$sample_permalink_html should be urldecoded at some stage before echoed.

Screenshot attached.

Attachments (4)

sample_permalink_html.PNG (21.6 KB) - added by linuxologos 3 years ago.
sample_permalink_html-urldecoded.PNG (15.3 KB) - added by linuxologos 3 years ago.
Same permalink, urldecoded.
16496.patch (806 bytes) - added by linuxologos 2 years ago.
16496.2.patch (473 bytes) - added by linuxologos 2 years ago.

Download all attachments as: .zip

Change History (8)

linuxologos3 years ago

Same permalink, urldecoded.

comment:1 follow-up: scribu3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

That is actually the URL you would get if you were to copy/paste from the browser's location bar.

I was going to say that we should try to fix the slug sanitization, but since all letters can be non-ascii, like in the screenshot, we should fix this instead.

Version 0, edited 3 years ago by scribu (next)

comment:2 SergeyBiryukov3 years ago

Also, when using an IDN domain, sample permalink displays it in Punycode. It should be human-readable too.

comment:3 in reply to: ↑ 1 SergeyBiryukov3 years ago

Replying to scribu:

That is actually the text you would get if you were to copy/paste from the browser's location bar.

In Opera and Safari an URL is copied in human-readable form.

linuxologos2 years ago

linuxologos2 years ago

comment:4 linuxologos2 years ago

  • Keywords has-patch added; needs-patch removed

16496.patch urldecodes $sample_permalink_html upon definition.
16496.2.patch urldecodes $sample_permalink_html just before being echoed.

The latter can affect the Shortlink part and may not be desirable.

A third solution would be to alter the get_sample_permalink_html() function in wp-admin/includes/post.php, but it doesn't sound as the best solution.

The local $sample_permalink_html in wp-admin/edit-form-advanced.php is definitely intended to be printed on screen, so it can and should be human-readable.

Note: See TracTickets for help on using tickets.