Opened 15 years ago
Last modified 2 weeks ago
#17661 new defect (bug)
Appending date & author based query vars to a permalink overrides the permalink
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.1 |
| Component: | Canonical | Keywords: | has-patch needs-unit-tests needs-refresh |
| Focuses: | Cc: |
Description
Some canonical code branches are not properly accounting for extra query variables being specified via the url.
For example, these url's are not handled properly:
/2008/?author=1 redirects to /author/admin/ /author/admin/?year=2008 redirects to /year/2008/ /category/uncategorized/?year=2008 redirects to /2008/
This happens with most date based branches, as once a higher priority canonical rule is hit, the permalink component is ignored.
The canonical code includes a branch to add any "forgotten" $_GET variables back onto the url, however this doesn't help when it's the rewritten variables are being lost.
Attachments (3)
Change History (8)
#5
@
2 weeks ago
- Keywords needs-testing removed
I attempted to apply the available patches against trunk (7.0-alpha-61215-src).
Both 17661.diff and 17661-tests.patch failed to apply cleanly, with multiple reject files generated.
Given the age of these patches and changes in canonical and related code since then, the patches appear to be outdated and need to be refreshed against current trunk.
Since the patches cannot currently be tested, I have removed the needs-testing keyword. This ticket already has `needs-
This is probably happening in a million other combinations as well - here's the problem:
1) the flags for
is_*are misleading because they are set to true for every present query var, regardless of rewrite structure2) the redirection happens because
redirect_canonical()says "I'm a year! and the year is in the query string when I want pretty permalinks, redirect me!" - it doesn't, however, check if the year is also the matched query or not.3) /2012/?year=2012 and /?year=2012 should be redirected to /2012/, /{NOT_YEAR}/?year=2012 should not
My patch fixes this for this ticket's use cases - I'm sure there are other cases which could be addressed.