strip www before adding subdomain when creating new site

git-svn-id: http://svn.automattic.com/wordpress/trunk@15050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-05-29 00:32:10 +00:00
parent 35d800986f
commit 1c6f95023b
4 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@ switch ( $_GET['action'] ) {
wp_die( __( 'Invalid email address.' ) ); wp_die( __( 'Invalid email address.' ) );
if ( is_subdomain_install() ) { if ( is_subdomain_install() ) {
$newdomain = $domain . '.' . $current_site->domain; $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
$path = $base; $path = $base;
} else { } else {
$newdomain = $current_site->domain; $newdomain = $current_site->domain;

View File

@ -714,7 +714,7 @@ switch ( $action ) {
<th scope="row"><?php _e( 'Site Address' ) ?></th> <th scope="row"><?php _e( 'Site Address' ) ?></th>
<td> <td>
<?php if ( is_subdomain_install() ) { ?> <?php if ( is_subdomain_install() ) { ?>
<input name="blog[domain]" type="text" class="regular-text" title="<?php _e( 'Domain' ) ?>"/>.<?php echo $current_site->domain;?> <input name="blog[domain]" type="text" class="regular-text" title="<?php _e( 'Domain' ) ?>"/>.<?php echo preg_replace( '|^www\.|', '', $current_site->domain );?>
<?php } else { <?php } else {
echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e( 'Domain' ) ?>"/> echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php _e( 'Domain' ) ?>"/>
<?php } <?php }

View File

@ -597,7 +597,7 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
// Check if the domain/path has been used already. // Check if the domain/path has been used already.
if ( is_subdomain_install() ) { if ( is_subdomain_install() ) {
$mydomain = "$blogname.$domain"; $mydomain = $blogname . '.' . preg_replace( '|^www\.|', '', $domain );
$path = $base; $path = $base;
} else { } else {
$mydomain = "$domain"; $mydomain = "$domain";

View File

@ -78,15 +78,15 @@ function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
if ( !is_subdomain_install() ) if ( !is_subdomain_install() )
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 />'; 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 />';
else else
echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="50" /><span class="suffix_address">.' . $current_site->domain . '</span><br />'; 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 />';
if ( !is_user_logged_in() ) { if ( !is_user_logged_in() ) {
print '(<strong>' . __( 'Your address will be ' ); print '(<strong>' . __( 'Your address will be ' );
if ( !is_subdomain_install() ) if ( !is_subdomain_install() )
print $current_site->domain . $current_site->path . __( 'sitename' ); print $current_site->domain . $current_site->path . __( 'sitename' );
else else
print __( 'domain.' ) . $current_site->domain . $current_site->path; print __( 'domain.' ) . $site_domain . $current_site->path;
echo '.)</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>'; echo '.</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>';
} }
// Blog Title // Blog Title