Changeset 42343 for trunk/src/wp-admin/install.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/install.php
r42228 r42343 77 77 ?> 78 78 </head> 79 <body class="wp-core-ui<?php echo $body_classes ?>">79 <body class="wp-core-ui<?php echo $body_classes; ?>"> 80 80 <p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p> 81 81 … … 95 95 global $wpdb; 96 96 97 $sql = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->users ) );97 $sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->users ) ); 98 98 $user_table = ( $wpdb->get_var( $sql ) != null ); 99 99 … … 105 105 106 106 $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; 107 $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';108 $admin_email = isset( $_POST['admin_email'] 107 $user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : ''; 108 $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : ''; 109 109 110 110 if ( ! is_null( $error ) ) { … … 120 120 </tr> 121 121 <tr> 122 <th scope="row"><label for="user_login"><?php _e( 'Username'); ?></label></th>122 <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?></label></th> 123 123 <td> 124 124 <?php 125 125 if ( $user_table ) { 126 _e( 'User(s) already exists.');126 _e( 'User(s) already exists.' ); 127 127 echo '<input name="user_name" type="hidden" value="admin" />'; 128 128 } else { 129 ?><input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" /> 129 ?> 130 <input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" /> 130 131 <p><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.' ); ?></p> 131 132 <?php 132 } ?> 133 } 134 ?> 133 135 </td> 134 136 </tr> … … 187 189 <legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend> 188 190 <?php 189 if ( has_action( 'blog_privacy_selector' ) ) { ?> 191 if ( has_action( 'blog_privacy_selector' ) ) { 192 ?> 190 193 <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( 1, $blog_public ); ?> /> 191 <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>194 <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/> 192 195 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( 0, $blog_public ); ?> /> 193 196 <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> … … 196 199 /** This action is documented in wp-admin/options-reading.php */ 197 200 do_action( 'blog_privacy_selector' ); 198 } else { ?> 201 } else { 202 ?> 199 203 <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( 0, $blog_public ); ?> /> 200 204 <?php _e( 'Discourage search engines from indexing this site' ); ?></label> … … 230 234 global $wp_version, $required_php_version, $required_mysql_version; 231 235 232 $php_version 233 $mysql_version 234 $php_compat 235 $mysql_compat 236 237 if ( ! $mysql_compat && !$php_compat ) {236 $php_version = phpversion(); 237 $mysql_version = $wpdb->db_version(); 238 $php_compat = version_compare( $php_version, $required_php_version, '>=' ); 239 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); 240 241 if ( ! $mysql_compat && ! $php_compat ) { 238 242 /* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Minimum required MySQL version number, 4: Current PHP version number, 5: Current MySQL version number */ 239 243 $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); 240 } elseif ( ! $php_compat ) {244 } elseif ( ! $php_compat ) { 241 245 /* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */ 242 246 $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ); 243 } elseif ( ! $mysql_compat ) {247 } elseif ( ! $mysql_compat ) { 244 248 /* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */ 245 249 $compat = sprintf( __( 'You cannot install because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ); 246 250 } 247 251 248 if ( ! $mysql_compat || !$php_compat ) {252 if ( ! $mysql_compat || ! $php_compat ) { 249 253 display_header(); 250 254 die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' ); … … 289 293 $scripts_to_print = array( 'jquery' ); 290 294 291 switch ($step) {295 switch ( $step ) { 292 296 case 0: // Step 0 293 297 if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) { … … 326 330 case 2: 327 331 if ( ! empty( $language ) && load_default_textdomain( $language ) ) { 328 $loaded_language = $language;332 $loaded_language = $language; 329 333 $GLOBALS['wp_locale'] = new WP_Locale(); 330 334 } else { … … 332 336 } 333 337 334 if ( ! empty( $wpdb->error ) ) 338 if ( ! empty( $wpdb->error ) ) { 335 339 wp_die( $wpdb->error->get_error_message() ); 340 } 336 341 337 342 $scripts_to_print[] = 'user-profile'; … … 339 344 display_header(); 340 345 // Fill in the data we gathered 341 $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';342 $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';343 $admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : '';344 $admin_password_check = isset( $_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : '';345 $admin_email = isset( $_POST['admin_email'] ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : '';346 $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;346 $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; 347 $user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : ''; 348 $admin_password = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : ''; 349 $admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : ''; 350 $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : ''; 351 $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1; 347 352 348 353 // Check email address. … … 385 390 <tr> 386 391 <th><?php _e( 'Password' ); ?></th> 387 <td><?php 388 if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ): ?> 389 <code><?php echo esc_html( $result['password'] ) ?></code><br /> 392 <td> 393 <?php 394 if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ) : 395 ?> 396 <code><?php echo esc_html( $result['password'] ); ?></code><br /> 390 397 <?php endif ?> 391 <p><?php echo $result['password_message'] ?></p>398 <p><?php echo $result['password_message']; ?></p> 392 399 </td> 393 400 </tr>
Note: See TracChangeset
for help on using the changeset viewer.