WordPress.org

Make WordPress Core

Ticket #21573: 21573.patch

File 21573.patch, 748 bytes (added by bungeshea, 12 months ago)

Bail early in maybe_redirect_404 function on subdomain installs

  • ms-functions.php

     
    16071607} 
    16081608 
    16091609/** 
    1610  * Correct 404 redirects when NOBLOGREDIRECT is defined. 
     1610 * Correct 404 redirects on subdirectory installs 
     1611 * when NOBLOGREDIRECT is defined. 
    16111612 * 
    16121613 * @since MU 
    16131614 */ 
    16141615function maybe_redirect_404() { 
     1616 
     1617        // If we're running on a subdomain install, bail early 
     1618        if ( is_subdomain_install() ) 
     1619                return; 
     1620 
     1621        // Otherwise, do the redirect 
    16151622        global $current_site; 
    16161623        if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) && ( $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ) ) ) { 
    16171624                if ( $destination == '%siteurl%' )