Ticket #9102: 9102.diff
File 9102.diff, 2.4 KB (added by , 16 years ago) |
---|
-
wp-includes/link-template.php
1229 1229 $home_root = parse_url(get_option('home')); 1230 1230 $home_root = ( isset($home_root['path']) ) ? $home_root['path'] : ''; 1231 1231 $home_root = preg_quote( trailingslashit( $home_root ), '|' ); 1232 if ( get_option('home') != get_option('siteurl') ) { 1233 $site_root = parse_url(get_option('siteurl')); 1234 $site_root = ( isset($site_root['path']) ) ? $site_root['path'] : ''; 1235 $site_root = preg_quote( trailingslashit( $site_root ), '|' ); 1236 } else { 1237 $site_root = false; 1238 } 1232 1239 1233 1240 $request = preg_replace('|^'. $home_root . '|', '', $request); 1241 if ( $site_root ) 1242 $request = preg_replace('|^'. $home_root . '|', '', $request); 1234 1243 $request = preg_replace('|^/+|', '', $request); 1235 1244 1236 1245 if ( !$wp_rewrite->using_permalinks() || is_admin() ) { -
wp-includes/classes.php
165 165 else 166 166 $home_path = ''; 167 167 $home_path = trim($home_path, '/'); 168 if ( get_option('home') != get_option('siteurl') ) { 169 $site_path = parse_url(get_option('siteurl')); 170 if ( isset($site_path['path']) ) 171 $site_path = $site_path['path']; 172 else 173 $site_path = ''; 174 $site_path = trim($site_path, '/'); 175 } else { 176 $site_path = false; 177 } 168 178 169 179 // Trim path info from the end and the leading home path from the 170 180 // front. For path info requests, this leaves us with the requesting … … 173 183 $req_uri = str_replace($pathinfo, '', rawurldecode($req_uri)); 174 184 $req_uri = trim($req_uri, '/'); 175 185 $req_uri = preg_replace("|^$home_path|", '', $req_uri); 186 if ( $site_path ) 187 $req_uri = preg_replace("|^$site_path|", '', $req_uri); 176 188 $req_uri = trim($req_uri, '/'); 177 189 $pathinfo = trim($pathinfo, '/'); 178 190 $pathinfo = preg_replace("|^$home_path|", '', $pathinfo); 191 if ( $site_path ) 192 $pathinfo = preg_replace("|^$site_path|", '', $pathinfo); 179 193 $pathinfo = trim($pathinfo, '/'); 180 194 $self = trim($self, '/'); 181 195 $self = preg_replace("|^$home_path|", '', $self); 196 if ( $site_path ) 197 $self = preg_replace("|^$site_path|", '', $self); 182 198 $self = trim($self, '/'); 183 199 184 200 // The requested permalink is in $pathinfo for path info requests and