WordPress.org

Make WordPress Core

Changes between Initial Version and Version 3 of Ticket #19688


Ignore:
Timestamp:
01/06/12 21:45:59 (4 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19688

    • Property Cc mikeschinkel@… added
  • Ticket #19688 – Description

    initial v3  
    22 
    33I tracked this down, and what I found is that code in class_wp->parse_request is causing this - particularly the code starting around line 166ish in version 3.3. The lines in particular that mess things up are these three: 
    4  
     4{{{ 
    55$pathinfo = trim($pathinfo, '/'); 
    66$pathinfo = preg_replace("|^$home_path|", '', $pathinfo); 
    77$pathinfo = trim($pathinfo, '/'); 
    8  
     8}}} 
    99Coming into these lines of code, $pathinfo is /store-locator/, but after those three lines of code $pathinfo is tore-locator (the leading s is missing). This is because $home_path comes from home_url() which strips trailing slashes. The code right before this block further strips $home_path down to just the subdirectory portion, which in my case is just "s". Then the preg_replace fires and the leading s on the path is lost.  
    1010 
    1111Temporarily, I added the following line before the three lines above and my problems went away: 
    12  
     12{{{ 
    1313$home_path .= "/"; 
    14  
     14}}} 
    1515Obviously this only works in my particular situation, and I'd like to be able to run vanilla Wordpress, but I can't find any combination of settings that will preserve my required permalink structure and still work. If there's a configuration combination that I'm missing, I'd be very happy, otherwise, feel free to contact me if you would like more info or if I can help in any way.