WordPress.org

Make WordPress Core

Ticket #31300: 31300.diff

File 31300.diff, 994 bytes (added by stephenharris, 5 years ago)
  • src/wp-includes/canonical.php

    diff --git src/wp-includes/canonical.php src/wp-includes/canonical.php
    index 4e247a9..e6735a7 100644
    function redirect_canonical( $requested_url = null, $do_redirect = true ) { 
    442442                        $redirect_url .= '?' . $redirect['query'];
    443443        }
    444444
    445         if ( !$redirect_url || $redirect_url == $requested_url )
    446                 return false;
    447 
    448445        // Hex encoded octets are case-insensitive.
    449446        if ( false !== strpos($requested_url, '%') ) {
    450447                if ( !function_exists('lowercase_octets') ) {
    function redirect_canonical( $requested_url = null, $do_redirect = true ) { 
    467464         */
    468465        $redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url );
    469466
    470         if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request
     467        if ( !$redirect_url || $redirect_url == $requested_url ){
    471468                return false;
     469        }
    472470
    473471        if ( $do_redirect ) {
    474472                // protect against chained redirects