Opened 6 years ago
Last modified 6 years ago
#52376 new defect (bug)
Redirect loop occurs in taxonomy archive with URL-encoded slug.
| Reported by: | Toro_Unit | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Canonical | Version: | |
| Severity: | normal | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
Description
The following steps will occur.
- Create taxonomy with
rewrite => false.
<?php $args = array( 'label' => 'Genre', 'public' => true, 'rewrite' => false, ); register_taxonomy( 'genre', array( 'post' ), $args );
- Create a term with URL-encoded slugs. ( example: 🏠, ワードプレス )
- Set Permalink structure to to something other than Plain.
- Go to the archive of the created term.
- Redirect loop.
remove_action( 'template_redirect', 'redirect_canonical' ), it will not occur.
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The issue is
$redirect['query']and$original['query']are never equal because it's comparing the urlencoded vs non urlencoded version.For example
Basically the _value_ of _genre_ are the same, urlencoded-wise.
We still use the same logic as the previous
$compare_original !== $compare_redirect, we just changed it so that we can handle thequerydifference.This still needs more eyes and testing.
Trac ticket: https://core.trac.wordpress.org/ticket/52376