WordPress.org

Make WordPress Core

Ticket #39311: fix-multisite.39311.3.diff

File fix-multisite.39311.3.diff, 1.0 KB (added by pkarjala, 13 months ago)

Add Subfolder check to network_site_url() and network_home_url() calls.

  • wp-includes/link-template.php

    diff --git wp-includes/link-template.php wp-includes/link-template.php
    index 77b18c6fca..7e29cfa82d 100644
    function network_site_url( $path = '', $scheme = null ) { 
    33733373                $url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
    33743374        }
    33753375
     3376        if ( SUBDOMAIN_INSTALL === false ) {
     3377                $current_blog = get_blog_details();
     3378                if ( $current_blog->path != '/' ) {
     3379                        $path = $current_blog->path . $path;
     3380                }
     3381        }       
     3382
    33763383        if ( $path && is_string( $path ) ) {
    33773384                $url .= ltrim( $path, '/' );
    33783385        }
    function network_home_url( $path = '', $scheme = null ) { 
    34233430                $url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme );
    34243431        }
    34253432
     3433        if ( SUBDOMAIN_INSTALL === false ) {
     3434                $current_blog = get_blog_details();
     3435                if ( $current_blog->path != '/' ) {
     3436                        $path = $current_blog->path . $path;
     3437                }
     3438        }       
     3439
    34263440        if ( $path && is_string( $path ) ) {
    34273441                $url .= ltrim( $path, '/' );
    34283442        }