Opened 5 years ago
Last modified 5 years ago
#52376 new defect (bug)
Redirect loop occurs in taxonomy archive with URL-encoded slug.
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Canonical | Keywords: | has-patch needs-testing |
| Focuses: | Cc: |
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.
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