WordPress.org

Make WordPress Core

Changeset 15438


Ignore:
Timestamp:
07/18/10 13:47:24 (5 years ago)
Author:
ryan
Message:

Hex octets are case-insenstive. Don't 301 when only the octet case differs. Props hakre. fixes #14292 for 3.0.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/wp-includes/canonical.php

    r14954 r15438  
    344344    if ( !$redirect_url || $redirect_url == $requested_url ) 
    345345        return false; 
     346         
     347    // Hex encoded octets are case-insensitive.  
     348    if ( false !== strpos($requested_url, '%') ) { 
     349        if ( !function_exists('lowercase_octets') ) { 
     350            function lowercase_octets($matches) {  
     351                return strtolower( $matches[0] );  
     352            }  
     353        } 
     354        $requested_url = preg_replace_callback('|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url); 
     355    } 
    346356 
    347357    // Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE 
Note: See TracChangeset for help on using the changeset viewer.