WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 2 years ago

#17450 reopened defect (bug)

Almost pretty permalinks with non-ASCII characters do not work in Apache

Reported by: peaceablewhale Owned by: westi
Milestone: Future Release Priority: normal
Severity: major Version: 3.1
Component: Permalinks Keywords: has-patch needs-testing needs-unit-tests 3.5-early
Focuses: Cc:

Description

Almost pretty permalinks (using PATH_INFO) with non-ASCII characters do not work in Apache; a not found error is returned. The same permalink works in IIS when UTF-8 is used for server variables. It also works when mod_rewrite is used.

Attachments (2)

17450.diff (975 bytes) - added by solarissmoke 3 years ago.
17450.patch (770 bytes) - added by peaceablewhale 3 years ago.

Download all attachments as: .zip

Change History (15)

solarissmoke3 years ago

comment:1 solarissmoke3 years ago

  • Keywords has-patch needs-testing added

The problem is not just with Apache. Here's the issue: PATH_INFO is (according to the CGI spec) supplied url-decoded, but REQUEST_URI us url-encoded. !Wordpress does string comparisons on these two, which is fine when there are only ascii characters in the URL, but fails when there are others.

Here is a patch that works for me. I imagine it will need some testing to make sure the behaviour is consistent in all environments.

comment:2 peaceablewhale3 years ago

Patch breaks almost pretty permalinks in IIS. Trying to fix it.

comment:3 peaceablewhale3 years ago

Revised patch. Workaround now applies to Apache only.

peaceablewhale3 years ago

comment:4 peaceablewhale3 years ago

Unfortunately, encoding PATH_INFO does not work either. I have reversed the patch logic so that we now decode REQUEST_URI instead. Verified effective in both IIS and Apache.

comment:5 peaceablewhale3 years ago

  • Version changed from 3.1.2 to 3.2

comment:6 peaceablewhale3 years ago

  • Owner set to westi
  • Status changed from new to reviewing

westi, I guess you may be the appropriate person to review this ticket, as I noticed your experience in resolving tickets related to servers~

comment:7 SergeyBiryukov3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from reviewing to closed

This is caused by [15960] and can be fixed by the latest patches in #10249.

comment:8 SergeyBiryukov3 years ago

  • Milestone set to 3.3
  • Resolution duplicate deleted
  • Status changed from closed to reopened
  • Version changed from 3.2 to 3.1

Not exactly a duplicate of the original #10249 bug, just related. 3.1 is the earliest affected version.

Still, 10249.4.patch fixes that.

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

comment:9 SergeyBiryukov3 years ago

  • Keywords needs-unit-tests added

comment:10 SergeyBiryukov2 years ago

  • Milestone changed from 3.3 to Future Release

comment:11 peaceablewhale2 years ago

How may unit test cases be made?

comment:12 SergeyBiryukov2 years ago

  • Milestone changed from Future Release to 3.4

comment:13 nacin2 years ago

  • Keywords 3.5-early added
  • Milestone changed from 3.4 to Future Release

Keeping on the same path as #10249.

Note: See TracTickets for help on using tickets.