WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#8418 closed enhancement (fixed)

Sample permalink URL-encoded

Reported by: janbrasna Owned by:
Milestone: 2.7 Priority: normal
Severity: minor Version: 2.7
Component: Administration Keywords: permalink admin preview utf urlencoded has-patch needs-feedback
Focuses: Cc:

Description

When using a non-latin post title, the previewed permalink appears URL-encoded (see $ATT). Since it's just an informative display of the slug, I believe that a non-encoded readable format would be more helpful for users to make them able to check the slug.

It would also fix a bug (probably jquery-related somewhere in slug.js) when an URL-encoded slug like "%e6%88%90%e7%9…" can't be edited inline, since the input doesn't get populated by such slug.

A simple fix is to add a default filter for the 'editable_slug' hook, see the attached patch. (This fixes the same issue for taxonomy slug edits etc. as well.)

(Since no characters that would require converting to special chars are ever produced by the permalink routine, I assume it's safe to URL-decode the string and leaving it then as-is for HTML output.)

Attachments (3)

admin-slug-uriencoded.png (20.4 KB) - added by janbrasna 5 years ago.
Encoded permalink
admin-slug-uridecoded.png (20.0 KB) - added by janbrasna 5 years ago.
Decoded view
default-filters.php.diff (574 bytes) - added by janbrasna 5 years ago.
Patch

Download all attachments as: .zip

Change History (4)

janbrasna5 years ago

Encoded permalink

janbrasna5 years ago

Decoded view

janbrasna5 years ago

Patch

comment:1 markjaquith5 years ago

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

(In [10108]) urldecode slugs in the Edit Post screen permalink. props janbrasna. fixes #8418

Note: See TracTickets for help on using tickets.