Make WordPress Core


Ignore:
Timestamp:
01/20/2010 08:42:20 PM (17 years ago)
Author:
wpmuguru
Message:

make server address in network settings a label, See #11644

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-network.php

    r12757 r12777  
    152152                                <th scope='row'>Server Address</th>
    153153                                <td>
    154                                         <p>What is the Internet address of your site? You should enter the shortest address possible. For example, use <em>example.com</em> instead of <em>www.example.com</em> but if you are going to use an address like <em>blogs.example.com</em> then enter that unaltered in the box below.</p>
    155                                         <input type='text' name='basedomain' value='<?php echo $hostname ?>' />
    156                                         <p>Do not use an IP address (like 127.0.0.1) or a single word hostname like <q>localhost</q> as your server address, use <q>localhost.localdomain</q> instead.</p>
     154                                        <p>This will be the Internet address of your site: <strong><em><?php echo $hostname; ?></em></strong>.</p>
     155                                        <input type='hidden' name='basedomain' value='<?php echo $hostname ?>' />
     156                                        <p>Do not use an IP address (like 127.0.0.1) or a single word hostname like <q>localhost</q> as your server address.</p>
    157157                                </td>
    158158                        </tr>
     
    263263function get_clean_basedomain() {
    264264        global $wpdb;
    265         $domain =   $wpdb->escape( $_POST[ 'basedomain' ] );
    266         $domain = str_replace( 'http://', '', $domain );
     265        $domain = preg_replace( '|https?://|', '', get_option( 'siteurl') );
     266        //@todo: address no www in multisite code
    267267        if( substr( $domain, 0, 4 ) == 'www.' )
    268268                $domain = substr( $domain, 4 );
     
    309309                require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    310310                // create network tables
    311                 $_SERVER[ 'HTTP_HOST' ] = str_replace( 'www.', '', $_SERVER[ 'HTTP_HOST' ] ); // normalise hostname - no www.
     311                $domain = get_clean_basedomain();
    312312                install_network();
    313                 populate_network( 1, $_SERVER[ 'HTTP_HOST' ], sanitize_email( $_POST[ 'email' ] ), $_POST[ 'weblog_title' ], $base, $_POST[ 'vhost' ] );
     313                populate_network( 1, $domain, sanitize_email( $_POST[ 'email' ] ), $_POST[ 'weblog_title' ], $base, $_POST[ 'vhost' ] );
    314314                // create wp-config.php / htaccess
    315315                step2();
    316 //continue;
    317                
    318 //              step3();
    319316        break;
    320317        default:
Note: See TracChangeset for help on using the changeset viewer.