WordPress.org

Make WordPress Core

Ticket #19253: fix-case-sensitive-home-url.patch

File fix-case-sensitive-home-url.patch, 932 bytes (added by Omicron7, 4 years ago)

Patch to add case insensitive matching to the home url while parsing a request.

  • wp-includes/class-wp.php

     
    161161                        // requested permalink. 
    162162                        $req_uri = str_replace($pathinfo, '', $req_uri); 
    163163                        $req_uri = trim($req_uri, '/'); 
    164                         $req_uri = preg_replace("|^$home_path|", '', $req_uri); 
     164                        $req_uri = preg_replace("|^$home_path|i", '', $req_uri); 
    165165                        $req_uri = trim($req_uri, '/'); 
    166166                        $pathinfo = trim($pathinfo, '/'); 
    167                         $pathinfo = preg_replace("|^$home_path|", '', $pathinfo); 
     167                        $pathinfo = preg_replace("|^$home_path|i", '', $pathinfo); 
    168168                        $pathinfo = trim($pathinfo, '/'); 
    169169                        $self = trim($self, '/'); 
    170                         $self = preg_replace("|^$home_path|", '', $self); 
     170                        $self = preg_replace("|^$home_path|i", '', $self); 
    171171                        $self = trim($self, '/'); 
    172172 
    173173                        // The requested permalink is in $pathinfo for path info requests and