[wp-trac] [WordPress Trac] #44744: Bug on canonical redirect with Hebrew query string.
WordPress Trac
noreply at wordpress.org
Mon Aug 6 14:52:40 UTC 2018
#44744: Bug on canonical redirect with Hebrew query string.
--------------------------+-----------------------------
Reporter: yehudah | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Canonical | Version: 4.9.8
Severity: major | Keywords:
Focuses: |
--------------------------+-----------------------------
Hello,
Example URL:
http://domain.com/?שלום
The example comes after having problems with Woocommerce product filters.
Line 491-493 in {{{/wp-includes/canonical.php}}} we have this:
{{{#!php
<?php
if ( ! $redirect_url || $redirect_url == $requested_url ) {
return;
}
}}}
**The problem:**
This will fail because the $redirect_url is not URL safe format and
encoded like $requested_url.
**Possible solution:**
One line before we can use {{{wp_sanitize_redirect}}} function like this:
{{{#!php
<?php
$redirect_url = wp_sanitize_redirect( $redirect_url );
if ( ! $redirect_url || $redirect_url == $requested_url ) {
return;
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44744>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list