Make WordPress Core

Changeset 12883


Ignore:
Timestamp:
01/27/2010 10:10:41 PM (15 years ago)
Author:
wpmuguru
Message:

block multisite enable on localhost and ip address, see #11816

File:
1 edited

Legend:

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

    r12865 r12883  
    151151    $email = get_option( 'admin_email' );
    152152    $hostname = get_clean_basedomain();
     153    $invalid_host = false;
     154    if ( 'localhost' == $hostname || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $hostname, $match ) )
     155        $invalid_host = true;
    153156    if ( substr( $hostname, 0, 4 ) == 'www.' )
    154157        $nowww = substr( $hostname, 4 );
     
    175178                <th scope='row'><?php esc_html_e( 'Server Address' ); ?></th>
    176179                <td>
     180        <?php if ( !$invalid_host ) { ?>
    177181                    <p><?php printf( __( 'This will be the Internet address of your site: <strong><em>%s</em></strong>.' ), $hostname ); ?></p>
    178182                    <input type='hidden' name='basedomain' value='<?php echo esc_attr( $hostname ); ?>' />
     183        <?php } else { ?>
    179184                    <p><?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.' ); ?></p>
     185        <?php } ?>
    180186                </td>
    181187            </tr>
     
    199205            </tr>
    200206        </table>
     207        <?php if ( !$invalid_host ) { ?>
    201208        <p class='submit'><input class="button" name='submit' type='submit' value='<?php esc_attr_e( 'Proceed' ); ?>' /></p>
     209        <?php } ?>
    202210    <?php
    203211}
Note: See TracChangeset for help on using the changeset viewer.