Opened 8 years ago
Closed 2 years ago
#38331 closed defect (bug) (worksforme)
Pagination crashes when using Greek query arguments
Reported by: | kouratoras | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | major | Version: | 4.1 |
Component: | Canonical | Keywords: | needs-testing has-patch close |
Focuses: | Cc: |
Description
I have an issue in both WordPress stable (4.6.1
) and nightly build (4.7-alpha-38801
).
It happens only when I have pretty permalinks structure (i.e. the default Day and name
).
The steps to reproduce are:
- Set pretty permalinks structure (let's say
Day and name
) - Create some posts in order to have pagination on the front-end
- I visit the front-end
- I go to page 2 (let's say
/page/2/
) - I manually add some Greek query arguments in the URL (let's say
/page/2/?φοο=βαρ
) and click enter
What I see: the page crashes with a browser message The page isn't redirecting properly
. No errors in debug log.
Attachments (1)
Change History (7)
#1
@
8 years ago
- Keywords needs-patch needs-testing added
- Milestone changed from Awaiting Review to Future Release
- Version changed from trunk to 4.1
#2
@
8 years ago
- Component changed from Query to Canonical
- Priority changed from normal to low
- Severity changed from normal to major
#3
@
8 years ago
I did some debugging to see where this is coming from, here is what I found.
- In redirect_canonical() we use remove_query_arg() when there is pagination.
- This involves using parse_str() a couple of times, which has the side effect of urldecoding both the keys and the values in the query_string array.
- Immediately after we re-encode the values to compensate the said side effect, but we leave the keys behind.
This difference causes the redirect,
Im attaching a patch that works, Im not sure if there is a better way of doing it.
Note: See
TracTickets for help on using
tickets.
Confirmed. This occurs in WordPress versions back to 4.1, but not in 4.0 or earlier.