Make WordPress Core

Ticket #28273: 28273.patch

File 28273.patch, 686 bytes (added by JPry, 10 years ago)
  • src/wp-includes/ms-load.php

    diff --git src/wp-includes/ms-load.php src/wp-includes/ms-load.php
    index 02224bd..9c0f4f2 100644
    function get_site_by_path( $domain, $path, $segments = null ) { 
    372372                $site = $wpdb->get_row( $sql );
    373373        } else {
    374374                $site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $domains[0], $paths[0] ) );
     375
     376                // One last attempt, in case the path column is empty for the site. Addresses #28273
     377                if ( ! $site ) {
     378                        $site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = ''", $domains[0] ) );
     379                }
    375380        }
    376381
    377382        if ( $site ) {