Validation for network.php. props dremeda, see #13383.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-15 06:49:16 +00:00
parent a2a0b6041b
commit 88bce6a716
1 changed files with 5 additions and 4 deletions

View File

@ -96,7 +96,6 @@ include( './admin-header.php' );
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="">
<?php
/**
* Prints step 1 for Network installation process.
@ -109,7 +108,7 @@ include( './admin-header.php' );
function network_step1( $errors = false ) {
if ( get_option( 'siteurl' ) != get_option( 'home' ) ) {
echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . sprintf( __( 'Your <strong>WordPress address</strong> must match your <strong>Site address</strong> before creating a Network. See <a href="%s">General Settings</a>.' ), esc_url( admin_url( 'options-general.php' ) ) ) . '</strong></p></div>';
echo '<div class="error"><p><strong>' . __('Error:') . '</strong> ' . sprintf( __( 'Your <strong>WordPress address</strong> must match your <strong>Site address</strong> before creating a Network. See <a href="%s">General Settings</a>.' ), esc_url( admin_url( 'options-general.php' ) ) ) . '</p></div>';
echo '</div>';
include ('./admin-footer.php' );
die();
@ -126,7 +125,7 @@ function network_step1( $errors = false ) {
$hostname = get_clean_basedomain();
$has_ports = strstr( $hostname, ':' );
if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ) ) ) ) {
echo '<div class="error"><p><strong>' . __( 'Error:') . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</strong></p></div>';
echo '<div class="error"><p><strong>' . __( 'Error:') . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';
echo '<p>' . sprintf( __( 'You cannot use port numbers such as <code>%s</code>.' ), $has_ports ) . '</p>';
echo '<a href="' . esc_url( admin_url() ) . '">' . __( 'Return to Dashboard' ) . '</a>';
echo '</div>';
@ -134,6 +133,8 @@ function network_step1( $errors = false ) {
die();
}
echo '<form method="post" action="">';
wp_nonce_field( 'install-network-1' );
$error_codes = array();
@ -244,6 +245,7 @@ function network_step1( $errors = false ) {
</tr>
</table>
<p class='submit'><input class="button-primary" name='submit' type='submit' value='<?php esc_attr_e( 'Install' ); ?>' /></p>
</form>
<?php
}
@ -390,7 +392,6 @@ if ( $_POST ) {
network_step1();
}
?>
</form>
</div>
<?php include( './admin-footer.php' ); ?>