Opened 10 years ago
Closed 4 years ago
#38331 closed defect (bug) (worksforme)
Pagination crashes when using Greek query arguments
| Reported by: | kouratoras | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | |
| Component: | Canonical | Version: | 4.1 |
| Severity: | major | Keywords: | needs-testing has-patch close |
| Cc: | Focuses: |
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
@
10 years ago
- Keywords needs-patch needs-testing added
- Milestone Awaiting Review → Future Release
- Version trunk → 4.1
#3
@
10 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Confirmed. This occurs in WordPress versions back to 4.1, but not in 4.0 or earlier.