Changeset 3370

Show
Ignore:
Timestamp:
12/28/05 01:48:29 (3 years ago)
Author:
ryan
Message:

Anchor str replacements to head so that we don't replace across the entire string. fixes #2162

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/classes.php

    r3356 r3370  
    14621462            $home_path = parse_url(get_settings('home')); 
    14631463            $home_path = $home_path['path']; 
     1464            $home_path = trim($home_path, '/'); 
    14641465 
    14651466            // Trim path info from the end and the leading home path from the 
     
    14681469            // requested permalink.  
    14691470            $req_uri = str_replace($pathinfo, '', $req_uri); 
    1470             $req_uri = str_replace($home_path, '', $req_uri); 
    14711471            $req_uri = trim($req_uri, '/'); 
    1472             $pathinfo = str_replace($home_path, '', $pathinfo); 
     1472            $req_uri = preg_replace("|^$home_path|", '', $req_uri); 
     1473            $req_uri = trim($req_uri, '/'); 
    14731474            $pathinfo = trim($pathinfo, '/'); 
     1475            $pathinfo = preg_replace("|^$home_path|", '', $pathinfo); 
     1476            $pathinfo = trim($pathinfo, '/'); 
     1477            $self = trim($self, '/'); 
     1478            $self = preg_replace("|^$home_path|", '', $self); 
    14741479            $self = str_replace($home_path, '', $self); 
    14751480            $self = trim($self, '/');