Make WordPress Core


Ignore:
Timestamp:
01/08/2010 09:25:01 PM (15 years ago)
Author:
wpmuguru
Message:

Add is_subdomain_install() to ms code - Fixes #11796

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-settings.php

    r12632 r12674  
    11<?php
     2
     3/**
     4 * Whether a subdomain configuration is enabled
     5 *
     6 * @since 3.0
     7 *
     8 * @return bool True if subdomain configuration is enabled, false otherwise.
     9 */
     10function is_subdomain_install() {
     11    if ( defined('VHOST') && VHOST == 'yes' )
     12        return true;
     13
     14    return false;
     15}
     16
    217if( isset( $current_site ) && isset( $current_blog ) )
    318    return;
     
    6681    }
    6782    $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) );
    68     if( constant( 'VHOST' ) == 'yes' ) {
     83    if( is_subdomain_install() ) {
    6984        $current_site = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path = %s", $domain, $path) );
    7085        if( $current_site != null )
     
    114129    $current_site->blog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path='{$current_site->path}'" );
    115130
    116 if( constant( 'VHOST' ) == 'yes' ) {
     131if( is_subdomain_install() ) {
    117132    $current_blog = wp_cache_get( 'current_blog_' . $domain, 'site-options' );
    118133    if( !$current_blog ) {
     
    144159}
    145160
    146 if( defined( "WP_INSTALLING" ) == false && constant( 'VHOST' ) == 'yes' && !is_object( $current_blog ) ) {
     161if( defined( "WP_INSTALLING" ) == false && is_subdomain_install() && !is_object( $current_blog ) ) {
    147162    if( defined( 'NOBLOGREDIRECT' ) ) {
    148163        $destination = constant( 'NOBLOGREDIRECT' );
Note: See TracChangeset for help on using the changeset viewer.