Opened 5 weeks ago
Last modified 4 weeks 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)
This ticket was mentioned in βPR #956 on βWordPress/wordpress-develop by βdonmhico.
4 weeks ago
- Keywords has-patch added; needs-patch removed
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 thequery
difference.This still needs more eyes and testing.
Trac ticket: https://core.trac.wordpress.org/ticket/52376