WordPress.org

Make WordPress Core

Ticket #20560: 20876.diff

File 20876.diff, 1.2 KB (added by gradyetc, 6 years ago)

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

  • wp-includes/rewrite.php

     
    305305        $url_split = explode('?', $url);
    306306        $url = $url_split[0];
    307307
     308        $home_url = home_url('/');
     309       
    308310        // 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.') )
    310312                $url = str_replace('://', '://www.', $url);
    311313
    312314        // Strip 'www.' if it is present and shouldn't be
    313         if ( false === strpos(home_url(), '://www.') )
     315        if ( false === strpos($home_url, '://www.') )
    314316                $url = str_replace('://www.', '://', $url);
    315317
    316318        // Strip 'index.php/' if we're not using path info permalinks
    317319        if ( !$wp_rewrite->using_index_permalinks() )
    318320                $url = str_replace('index.php/', '', $url);
    319321
    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);
    323325        } else {
    324326                // Chop off /path/to/blog
    325327                $home_path = parse_url(home_url());