~canonical-sysadmins/wordpress/4.2.2

« back to all changes in this revision

Viewing changes to wp-admin/network/site-new.php

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:05:37 UTC
  • mfrom: (1.1.1 wp4-upstream)
  • Revision ID: nick.moffitt@canonical.com-20150115110537-8bp1y42eyg0jsa7c
Tags: 4.1
MergeĀ upstreamĀ versionĀ 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
                        wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
50
50
        }
51
51
 
52
 
        $email = sanitize_email( $blog['email'] );
53
52
        $title = $blog['title'];
54
53
 
55
54
        if ( empty( $domain ) )
56
55
                wp_die( __( 'Missing or invalid site address.' ) );
57
 
        if ( empty( $email ) )
 
56
 
 
57
        if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
58
58
                wp_die( __( 'Missing email address.' ) );
59
 
        if ( !is_email( $email ) )
 
59
        }
 
60
 
 
61
        $email = sanitize_email( $blog['email'] );
 
62
        if ( ! is_email( $email ) ) {
60
63
                wp_die( __( 'Invalid email address.' ) );
 
64
        }
61
65
 
62
66
        if ( is_subdomain_install() ) {
63
67
                $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
126
130
                        <th scope="row"><?php _e( 'Site Address' ) ?></th>
127
131
                        <td>
128
132
                        <?php if ( is_subdomain_install() ) { ?>
129
 
                                <input name="blog[domain]" type="text" class="regular-text" title="<?php esc_attr_e( 'Domain' ) ?>"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', $current_site->domain ); ?></span>
 
133
                                <input name="blog[domain]" type="text" class="regular-text" id="site-address" title="<?php esc_attr_e( 'Domain' ) ?>"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', $current_site->domain ); ?></span>
130
134
                        <?php } else {
131
 
                                echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
 
135
                                echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" id="site-address" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
132
136
                        <?php }
133
137
                        echo '<p>' . __( 'Only lowercase letters (a-z) and numbers are allowed.' ) . '</p>';
134
138
                        ?>
136
140
                </tr>
137
141
                <tr class="form-field form-required">
138
142
                        <th scope="row"><?php _e( 'Site Title' ) ?></th>
139
 
                        <td><input name="blog[title]" type="text" class="regular-text" title="<?php esc_attr_e( 'Title' ) ?>"/></td>
 
143
                        <td><input name="blog[title]" type="text" class="regular-text" id="site-title" title="<?php esc_attr_e( 'Title' ) ?>"/></td>
140
144
                </tr>
141
145
                <tr class="form-field form-required">
142
146
                        <th scope="row"><?php _e( 'Admin Email' ) ?></th>
143
 
                        <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" data-autocomplete-type="search" data-autocomplete-field="user_email" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
 
147
                        <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
144
148
                </tr>
145
149
                <tr class="form-field">
146
150
                        <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>