Ticket #20560: 20876.diff

File 20876.diff, 1.2 KB (added by gradyetc, 12 months ago)

Updated patch -- replaces trailingslashit() with home_url('/')

Line 
1Index: wp-includes/rewrite.php
2===================================================================
3--- wp-includes/rewrite.php     (revision 20876)
4+++ wp-includes/rewrite.php     (working copy)
5@@ -305,21 +305,23 @@
6        $url_split = explode('?', $url);
7        $url = $url_split[0];
8 
9+       $home_url = home_url('/');
10+       
11        // Add 'www.' if it is absent and should be there
12-       if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )
13+       if ( false !== strpos($home_url, '://www.') && false === strpos($url, '://www.') )
14                $url = str_replace('://', '://www.', $url);
15 
16        // Strip 'www.' if it is present and shouldn't be
17-       if ( false === strpos(home_url(), '://www.') )
18+       if ( false === strpos($home_url, '://www.') )
19                $url = str_replace('://www.', '://', $url);
20 
21        // Strip 'index.php/' if we're not using path info permalinks
22        if ( !$wp_rewrite->using_index_permalinks() )
23                $url = str_replace('index.php/', '', $url);
24 
25-       if ( false !== strpos($url, home_url()) ) {
26-               // Chop off http://domain.com
27-               $url = str_replace(home_url(), '', $url);
28+       if ( false !== strpos($url, $home_url) ) {
29+               // Chop off http://domain.com/
30+               $url = str_replace($home_url, '', $url);
31        } else {
32                // Chop off /path/to/blog
33                $home_path = parse_url(home_url());