Ticket #6723 (closed defect (bug): fixed)

Opened 9 months ago

Last modified 7 months ago

get_page_uri returns invalid URLs for multibyte page slug

Reported by: lilyfan Assigned to: ryan
Priority: normal Milestone: 2.6
Component: i18n Version: 2.5
Severity: normal Keywords: permalink, slug
Cc:

Description

If a page has a multibyte page slug (like %E4%BE%8B ; means "example" in japanese), get_page_uri() returns invalid URL as "http://example.com/例/". It is not compliant with RFC 1748, because a UTF-8 character is inlcuded in the path. The reason is that get_page_uri() does "urldecode($page->post_name)". Thus "%E4%BE%8B" is decoded to "例" (a UTF-8 character).

The solution is to avoid using urldecode().

Attachments

page-encoded-urls.diff (0.6 kB) - added by nbachiyski on 06/16/08 10:44:11.

Change History

04/15/08 16:11:32 changed by ryan

  • owner changed from anonymous to ryan.

06/16/08 10:43:59 changed by nbachiyski

The urldecode calls were introduced long ago in [1841] (1.3-alpha-4) when for some reason page names were double encoded.

The patch is attached.

06/16/08 10:44:11 changed by nbachiyski

  • attachment page-encoded-urls.diff added.

06/16/08 18:40:47 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [8096]) Don't decode slug in get_page_uri(). Props nbachiyski. fixes #6723