Ticket #20560: 20876.diff
File 20876.diff, 1.2 KB (added by , 12 years ago) |
---|
-
wp-includes/rewrite.php
305 305 $url_split = explode('?', $url); 306 306 $url = $url_split[0]; 307 307 308 $home_url = home_url('/'); 309 308 310 // Add 'www.' if it is absent and should be there 309 if ( false !== strpos( home_url(), '://www.') && false === strpos($url, '://www.') )311 if ( false !== strpos($home_url, '://www.') && false === strpos($url, '://www.') ) 310 312 $url = str_replace('://', '://www.', $url); 311 313 312 314 // Strip 'www.' if it is present and shouldn't be 313 if ( false === strpos( home_url(), '://www.') )315 if ( false === strpos($home_url, '://www.') ) 314 316 $url = str_replace('://www.', '://', $url); 315 317 316 318 // Strip 'index.php/' if we're not using path info permalinks 317 319 if ( !$wp_rewrite->using_index_permalinks() ) 318 320 $url = str_replace('index.php/', '', $url); 319 321 320 if ( false !== strpos($url, home_url()) ) {321 // Chop off http://domain.com 322 $url = str_replace( home_url(), '', $url);322 if ( false !== strpos($url, $home_url) ) { 323 // Chop off http://domain.com/ 324 $url = str_replace($home_url, '', $url); 323 325 } else { 324 326 // Chop off /path/to/blog 325 327 $home_path = parse_url(home_url());