Make WordPress Core

Ticket #12457: 12457.diff

File 12457.diff, 2.8 KB (added by Denis-de-Bernardy, 15 years ago)

first pass: allow to install MS in localhost/~denis/wp-trunk/

  • wp-admin/network.php

     
    153153        $email = get_option( 'admin_email' );
    154154        $hostname = get_clean_basedomain();
    155155        $invalid_host = false;
    156         if ( 'localhost' == $hostname || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $hostname, $match ) )
     156        if ( preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $hostname, $match ) )
    157157                $invalid_host = true;
     158        $localhost = ( 'localhost' == $hostname );
    158159        if ( substr( $hostname, 0, 4 ) == 'www.' )
    159160                $nowww = substr( $hostname, 4 );
    160 
     161        $base = stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) );
     162        if ( $base == '/' )
     163                $base = '';
     164       
    161165        wp_nonce_field( 'install-network-1' );
    162166        if ( network_domain_check() ) { ?>
    163167                <h2><?php esc_html_e( 'Existing Sites' ); ?></h2>
     
    176180                <p><?php _e( '<strong>Note</strong> It looks like <code>mod_rewrite</code> is not installed.' ); ?></p>
    177181                <?php } ?>
    178182                <p class="blog-address">
    179                         <label><input type='radio' name='vhost' value='yes'<?php if ( $rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-domains (like <code>blog1.example.com</code>)' ); ?></label><br />
    180                         <label><input type='radio' name='vhost' value='no'<?php if ( ! $rewrite_enabled ) echo ' checked="checked"'; ?> /> <?php _e( 'Sub-directories (like <code>example.com/blog1</code>)' ); ?></label>
     183                        <label><input type='radio' name='vhost' value='yes'<?php checked($rewrite_enabled && !$localhost && !$base, true); if ( $localhost ) echo ' disabled="disabled"'; ?> /> <?php echo sprintf(__( 'Sub-domains (like <code>blog1.%s</code>)' ), $hostname); ?></label><br />
     184                        <label><input type='radio' name='vhost' value='no'<?php checked($rewrite_enabled && !$localhost && !$base, false); ?> /> <?php echo sprintf(__( 'Sub-directories (like <code>%s/blog1</code>)' ), $hostname . $base); ?></label>
    181185                </p>
    182186
    183187                <h2><?php esc_html_e( 'Server Address' ); ?></h2>
     
    188192                        <tr>
    189193                                <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
    190194                                <td>
    191                 <?php if ( !$invalid_host ) { ?>
    192                                         <?php printf( __( 'This will be the Internet address of your site: <strong><em>%s</em></strong>.' ), $hostname ); ?>
     195                <?php if ( !$invalid_host ) { ?><code><?php echo home_url(); ?></code>
     196                                        <br />
     197                                        <?php _e( 'This will be the base Internet address of your site.' ); ?>
    193198                                        <input type='hidden' name='basedomain' value='<?php echo esc_attr( $hostname ); ?>' />
    194199                <?php } else { ?>
    195                                         <?php _e( 'Do not use an IP address (like 127.0.0.1) or a single word hostname like <q>localhost</q> as your server address.' ); ?>
     200                                        <?php _e( 'Do not use an IP address (like 127.0.0.1) as your server address.' ); ?>
    196201                <?php } ?>
    197202                                </td>
    198203                        </tr>