WordPress.org

Make WordPress Core

Changeset 15050


Ignore:
Timestamp:
05/29/2010 12:32:10 AM (12 years ago)
Author:
wpmuguru
Message:

strip www before adding subdomain when creating new site

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-edit.php

    r14928 r15050  
    168168
    169169        if ( is_subdomain_install() ) {
    170             $newdomain = $domain . '.' . $current_site->domain;
     170            $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
    171171            $path = $base;
    172172        } else {
  • trunk/wp-admin/ms-sites.php

    r15036 r15050  
    715715                        <td>
    716716                        <?php if ( is_subdomain_install() ) { ?>
    717                             <input name="blog[domain]" type="text" class="regular-text" title="<?php _e( 'Domain' ) ?>"/>.<?php echo $current_site->domain;?>
     717                            <input name="blog[domain]" type="text" class="regular-text" title="<?php _e( 'Domain' ) ?>"/>.<?php echo preg_replace( '|^www\.|', '', $current_site->domain );?>
    718718                        <?php } else {
    719719                            echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e( 'Domain' ) ?>"/>
  • trunk/wp-includes/ms-functions.php

    r15042 r15050  
    598598    // Check if the domain/path has been used already.
    599599    if ( is_subdomain_install() ) {
    600         $mydomain = "$blogname.$domain";
     600        $mydomain = $blogname . '.' . preg_replace( '|^www\.|', '', $domain );
    601601        $path = $base;
    602602    } else {
  • trunk/wp-signup.php

    r14898 r15050  
    7979        echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span><input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="50" /><br />';
    8080    else
    81         echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . '</span><br />';
     81        echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '</span><br />';
    8282
    8383    if ( !is_user_logged_in() ) {
     
    8686            print $current_site->domain . $current_site->path . __( 'sitename' );
    8787        else
    88             print __( 'domain.' ) . $current_site->domain . $current_site->path;
    89         echo '.)</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>';
     88            print __( 'domain.' ) . $site_domain . $current_site->path;
     89        echo '.</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>';
    9090    }
    9191
Note: See TracChangeset for help on using the changeset viewer.