Make WordPress Core

Opened 13 years ago

Closed 10 years ago

#16496 closed defect (bug) (fixed)

Make $sample_permalink_html human-readable on Edit Post screen

Reported by: linuxologos's profile linuxologos Owned by: johnbillion's profile johnbillion
Milestone: 4.1 Priority: normal
Severity: normal Version: 2.5
Component: Administration Keywords: has-patch commit
Focuses: administration Cc:


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 (5)

sample_permalink_html.PNG (21.6 KB) - added by linuxologos 13 years ago.
sample_permalink_html-urldecoded.PNG (15.3 KB) - added by linuxologos 13 years ago.
Same permalink, urldecoded.
16496.patch (806 bytes) - added by linuxologos 13 years ago.
16496.2.patch (473 bytes) - added by linuxologos 13 years ago.
16496.3.patch (717 bytes) - added by johnbillion 10 years ago.

Download all attachments as: .zip

Change History (12)

13 years ago

Same permalink, urldecoded.

#1 follow-up: @scribu
13 years ago

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

That is actually the text 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.

Last edited 13 years ago by scribu (previous) (diff)

#2 @SergeyBiryukov
13 years ago

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

#3 in reply to: ↑ 1 @SergeyBiryukov
13 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.

13 years ago

#4 @linuxologos
13 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.

#5 @chriscct7
10 years ago

  • Component changed from Formatting to Administration
  • Keywords reporter-feedback added

Seems to work for me.
@linuxologos is this still broken for you in WordPress 4.0?

#6 @johnbillion
10 years ago

  • Focuses administration added
  • Keywords commit added; reporter-feedback removed
  • Milestone changed from Future Release to 4.1
  • Type changed from enhancement to defect (bug)
  • Version set to 2.5

This is still an issue. It doesn't affect the post slug, just the rest of the permalink (eg. a when using a permastructure which includes the category name, and the post is in a category with punycode in its slug).

16496.3.patch urldecodes the permalink in the most appropriate place.

#7 @johnbillion
10 years ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 30364:

Decode the sample permalink shown to the user. This avoids showing encoded non-Latin characters in the sample permalink.

Fixes #16496
Props linuxologos

Note: See TracTickets for help on using tickets.