Make WordPress Core


Ignore:
Timestamp:
01/08/2010 09:25:01 PM (17 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-functions.php

    r12673 r12674  
    3232        global $current_site;
    3333
    34         if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) {
     34        if( is_subdomain_install() ) {
    3535                if( $blogname == 'main' )
    3636                        $blogname = 'www';
     
    4242
    4343function get_blogaddress_by_domain( $domain, $path ){
    44         if( defined( "VHOST" ) && constant( "VHOST" ) == 'yes' ) {
     44        if( is_subdomain_install() ) {
    4545                $url = "http://".$domain.$path;
    4646        } else {
     
    109109                return $blog_id;
    110110
    111         if ( defined('VHOST') && constant( 'VHOST' ) == 'yes' ) {
     111        if ( is_subdomain_install() ) {
    112112                $domain = $name . '.' . $current_site->domain;
    113113                $path = $current_site->path;
     
    10341034
    10351035        // do not allow users to create a blog that conflicts with a page on the main blog.
    1036         if ( constant( "VHOST" ) == 'no' && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_site->blog_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) {
     1036        if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_site->blog_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) {
    10371037                $errors->add( 'blogname', __( "Sorry, you may not use that blog name" ) );
    10381038        }
     
    10521052
    10531053        // Check if the domain/path has been used already.
    1054         if( constant( "VHOST" ) == 'yes' ) {
     1054        if( is_subdomain_install() ) {
    10551055                $mydomain = "$blogname.$domain";
    10561056                $path = $base;
     
    11391139
    11401140        // Send email with activation link.
    1141         if( constant( "VHOST" ) == 'no' || $current_site->id != 1 ) {
     1141        if( !is_subdomain_install() || $current_site->id != 1 ) {
    11421142                $activate_url = "http://" . $current_site->domain . $current_site->path . "wp-activate.php?key=$key";
    11431143        } else {
     
    12681268function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
    12691269        $domain = preg_replace( "/\s+/", '', sanitize_user( $domain, true ) );
    1270         if( constant( 'VHOST' ) == 'yes' )
     1270        if( is_subdomain_install() )
    12711271                $domain = str_replace( '@', '', $domain );
    12721272        $title = strip_tags( $title );
Note: See TracChangeset for help on using the changeset viewer.