wp/wp-admin/install.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
    14 <head>
    14 <head>
    15 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    15 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    16 	<title>Error: PHP is not running</title>
    16 	<title>Error: PHP is not running</title>
    17 </head>
    17 </head>
    18 <body class="wp-core-ui">
    18 <body class="wp-core-ui">
    19 	<h1 id="logo"><a href="https://wordpress.org/">WordPress</a></h1>
    19 	<p id="logo"><a href="https://wordpress.org/">WordPress</a></p>
    20 	<h2>Error: PHP is not running</h2>
    20 	<h1>Error: PHP is not running</h1>
    21 	<p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
    21 	<p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
    22 </body>
    22 </body>
    23 </html>
    23 </html>
    24 <?php
    24 <?php
    25 }
    25 }
    47 nocache_headers();
    47 nocache_headers();
    48 
    48 
    49 $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;
    49 $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;
    50 
    50 
    51 /**
    51 /**
    52  * Display install header.
    52  * Display installation header.
    53  *
    53  *
    54  * @since 2.5.0
    54  * @since 2.5.0
       
    55  *
       
    56  * @param string $body_classes
    55  */
    57  */
    56 function display_header( $body_classes = '' ) {
    58 function display_header( $body_classes = '' ) {
    57 	header( 'Content-Type: text/html; charset=utf-8' );
    59 	header( 'Content-Type: text/html; charset=utf-8' );
    58 	if ( is_rtl() ) {
    60 	if ( is_rtl() ) {
    59 		$body_classes .= 'rtl';
    61 		$body_classes .= 'rtl';
    65 <!DOCTYPE html>
    67 <!DOCTYPE html>
    66 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    68 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    67 <head>
    69 <head>
    68 	<meta name="viewport" content="width=device-width" />
    70 	<meta name="viewport" content="width=device-width" />
    69 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    71 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       
    72 	<meta name="robots" content="noindex,nofollow" />
    70 	<title><?php _e( 'WordPress &rsaquo; Installation' ); ?></title>
    73 	<title><?php _e( 'WordPress &rsaquo; Installation' ); ?></title>
    71 	<?php
    74 	<?php
    72 	wp_admin_css( 'install', true );
    75 		wp_admin_css( 'install', true );
       
    76 		wp_admin_css( 'dashicons', true );
    73 	?>
    77 	?>
    74 </head>
    78 </head>
    75 <body class="wp-core-ui<?php echo $body_classes ?>">
    79 <body class="wp-core-ui<?php echo $body_classes ?>">
    76 <h1 id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></h1>
    80 <p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p>
    77 
    81 
    78 <?php
    82 <?php
    79 } // end display_header()
    83 } // end display_header()
    80 
    84 
    81 /**
    85 /**
    82  * Display installer setup form.
    86  * Display installer setup form.
    83  *
    87  *
    84  * @since 2.8.0
    88  * @since 2.8.0
       
    89  *
       
    90  * @global wpdb $wpdb WordPress database abstraction object.
       
    91  *
       
    92  * @param string|null $error
    85  */
    93  */
    86 function display_setup_form( $error = null ) {
    94 function display_setup_form( $error = null ) {
    87 	global $wpdb;
    95 	global $wpdb;
    88 
    96 
    89 	$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 ) );
    99 	$user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
   107 	$user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
   100 	$admin_email  = isset( $_POST['admin_email']  ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
   108 	$admin_email  = isset( $_POST['admin_email']  ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
   101 
   109 
   102 	if ( ! is_null( $error ) ) {
   110 	if ( ! is_null( $error ) ) {
   103 ?>
   111 ?>
       
   112 <h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
   104 <p class="message"><?php echo $error; ?></p>
   113 <p class="message"><?php echo $error; ?></p>
   105 <?php } ?>
   114 <?php } ?>
   106 <form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
   115 <form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
   107 	<table class="form-table">
   116 	<table class="form-table">
   108 		<tr>
   117 		<tr>
   122 			<?php
   131 			<?php
   123 			} ?>
   132 			} ?>
   124 			</td>
   133 			</td>
   125 		</tr>
   134 		</tr>
   126 		<?php if ( ! $user_table ) : ?>
   135 		<?php if ( ! $user_table ) : ?>
   127 		<tr>
   136 		<tr class="form-field form-required user-pass1-wrap">
   128 			<th scope="row">
   137 			<th scope="row">
   129 				<label for="pass1"><?php _e('Password, twice'); ?></label>
   138 				<label for="pass1">
   130 				<p><?php _e('A password will be automatically generated for you if you leave this blank.'); ?></p>
   139 					<?php _e( 'Password' ); ?>
       
   140 				</label>
   131 			</th>
   141 			</th>
   132 			<td>
   142 			<td>
   133 				<input name="admin_password" type="password" id="pass1" size="25" value="" />
   143 				<div class="">
   134 				<p><input name="admin_password2" type="password" id="pass2" size="25" value="" /></p>
   144 					<?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?>
   135 				<div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
   145 					<input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" />
   136 				<p><?php echo wp_get_password_hint(); ?></p>
   146 					<button type="button" class="button wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset( $_POST['admin_password'] ); ?>" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
       
   147 						<span class="dashicons dashicons-hidden"></span>
       
   148 						<span class="text"><?php _e( 'Hide' ); ?></span>
       
   149 					</button>
       
   150 					<div id="pass-strength-result" aria-live="polite"></div>
       
   151 				</div>
       
   152 				<p><span class="description important hide-if-no-js">
       
   153 				<strong><?php _e( 'Important:' ); ?></strong>
       
   154 				<?php /* translators: The non-breaking space prevents 1Password from thinking the text "log in" should trigger a password save prompt. */ ?>
       
   155 				<?php _e( 'You will need this password to log&nbsp;in. Please store it in a secure location.' ); ?></span></p>
       
   156 			</td>
       
   157 		</tr>
       
   158 		<tr class="form-field form-required user-pass2-wrap hide-if-js">
       
   159 			<th scope="row">
       
   160 				<label for="pass2"><?php _e( 'Repeat Password' ); ?>
       
   161 					<span class="description"><?php _e( '(required)' ); ?></span>
       
   162 				</label>
       
   163 			</th>
       
   164 			<td>
       
   165 				<input name="admin_password2" type="password" id="pass2" autocomplete="off" />
       
   166 			</td>
       
   167 		</tr>
       
   168 		<tr class="pw-weak">
       
   169 			<th scope="row"><?php _e( 'Confirm Password' ); ?></th>
       
   170 			<td>
       
   171 				<label>
       
   172 					<input type="checkbox" name="pw_weak" class="pw-checkbox" />
       
   173 					<?php _e( 'Confirm use of weak password' ); ?>
       
   174 				</label>
   137 			</td>
   175 			</td>
   138 		</tr>
   176 		</tr>
   139 		<?php endif; ?>
   177 		<?php endif; ?>
   140 		<tr>
   178 		<tr>
   141 			<th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th>
   179 			<th scope="row"><label for="admin_email"><?php _e( 'Your Email' ); ?></label></th>
   142 			<td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
   180 			<td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
   143 			<p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
   181 			<p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
   144 		</tr>
   182 		</tr>
   145 		<tr>
   183 		<tr>
   146 			<th scope="row"><?php _e( 'Privacy' ); ?></th>
   184 			<th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?></th>
   147 			<td colspan="2"><label><input type="checkbox" name="blog_public" id="blog_public" value="1" <?php checked( $blog_public ); ?> /> <?php _e( 'Allow search engines to index this site.' ); ?></label></td>
   185 			<td>
       
   186 				<fieldset>
       
   187 					<legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend>
       
   188 					<?php
       
   189 					if ( has_action( 'blog_privacy_selector' ) ) { ?>
       
   190 						<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/>
       
   192 						<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
       
   193 						<label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>
       
   194 						<p class="description"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>
       
   195 						<?php
       
   196 						/** This action is documented in wp-admin/options-reading.php */
       
   197 						do_action( 'blog_privacy_selector' );
       
   198 					 } else { ?>
       
   199 						<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
       
   200 						<?php _e( 'Discourage search engines from indexing this site' ); ?></label>
       
   201 						<p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
       
   202 					<?php } ?>
       
   203 				</fieldset>
       
   204 			</td>
   148 		</tr>
   205 		</tr>
   149 	</table>
   206 	</table>
   150 	<p class="step"><input type="submit" name="Submit" value="<?php esc_attr_e( 'Install WordPress' ); ?>" class="button button-large" /></p>
   207 	<p class="step"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p>
   151 	<input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" />
   208 	<input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" />
   152 </form>
   209 </form>
   153 <?php
   210 <?php
   154 } // end display_setup_form()
   211 } // end display_setup_form()
   155 
   212 
   156 // Let's check to make sure WP isn't already installed.
   213 // Let's check to make sure WP isn't already installed.
   157 if ( is_blog_installed() ) {
   214 if ( is_blog_installed() ) {
   158 	display_header();
   215 	display_header();
   159 	die( '<h1>' . __( 'Already Installed' ) . '</h1><p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p><p class="step"><a href="../wp-login.php" class="button button-large">' . __( 'Log In' ) . '</a></p></body></html>' );
   216 	die(
   160 }
   217 		'<h1>' . __( 'Already Installed' ) . '</h1>' .
   161 
   218 		'<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' .
       
   219 		'<p class="step"><a href="' . esc_url( wp_login_url() ) . '" class="button button-large">' . __( 'Log In' ) . '</a></p>' .
       
   220 		'</body></html>'
       
   221 	);
       
   222 }
       
   223 
       
   224 /**
       
   225  * @global string $wp_version
       
   226  * @global string $required_php_version
       
   227  * @global string $required_mysql_version
       
   228  * @global wpdb   $wpdb
       
   229  */
   162 global $wp_version, $required_php_version, $required_mysql_version;
   230 global $wp_version, $required_php_version, $required_mysql_version;
   163 
   231 
   164 $php_version    = phpversion();
   232 $php_version    = phpversion();
   165 $mysql_version  = $wpdb->db_version();
   233 $mysql_version  = $wpdb->db_version();
   166 $php_compat     = version_compare( $php_version, $required_php_version, '>=' );
   234 $php_compat     = version_compare( $php_version, $required_php_version, '>=' );
   167 $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
   235 $mysql_compat   = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
   168 
   236 
   169 if ( !$mysql_compat && !$php_compat )
   237 if ( !$mysql_compat && !$php_compat ) {
       
   238 	/* 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 */
   170 	$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 );
   239 	$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 );
   171 elseif ( !$php_compat )
   240 } elseif ( !$php_compat ) {
       
   241 	/* translators: 1: WordPress version number, 2: Minimum required PHP version number, 3: Current PHP version number */
   172 	$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 );
   242 	$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 );
   173 elseif ( !$mysql_compat )
   243 } elseif ( !$mysql_compat ) {
       
   244 	/* translators: 1: WordPress version number, 2: Minimum required MySQL version number, 3: Current MySQL version number */
   174 	$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 );
   245 	$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 }
   175 
   247 
   176 if ( !$mysql_compat || !$php_compat ) {
   248 if ( !$mysql_compat || !$php_compat ) {
   177 	display_header();
   249 	display_header();
   178 	die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' );
   250 	die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' );
   179 }
   251 }
   180 
   252 
   181 if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
   253 if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) {
   182 	display_header();
   254 	display_header();
   183 	die( '<h1>' . __( 'Configuration Error' ) . '</h1><p>' . __( 'Your <code>wp-config.php</code> file has an empty database table prefix, which is not supported.' ) . '</p></body></html>' );
   255 	die(
   184 }
   256 		'<h1>' . __( 'Configuration Error' ) . '</h1>' .
   185 
   257 		'<p>' . sprintf(
       
   258 			/* translators: %s: wp-config.php */
       
   259 			__( 'Your %s file has an empty database table prefix, which is not supported.' ),
       
   260 			'<code>wp-config.php</code>'
       
   261 		) . '</p></body></html>'
       
   262 	);
       
   263 }
       
   264 
       
   265 // Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install.
       
   266 if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
       
   267 	display_header();
       
   268 	die(
       
   269 		'<h1>' . __( 'Configuration Error' ) . '</h1>' .
       
   270 		'<p>' . sprintf(
       
   271 			/* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */
       
   272 			__( 'The constant %s cannot be defined when installing WordPress.' ),
       
   273 			'<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'
       
   274 		) . '</p></body></html>'
       
   275 	);
       
   276 }
       
   277 
       
   278 /**
       
   279  * @global string    $wp_local_package
       
   280  * @global WP_Locale $wp_locale
       
   281  */
   186 $language = '';
   282 $language = '';
   187 if ( ! empty( $_REQUEST['language'] ) ) {
   283 if ( ! empty( $_REQUEST['language'] ) ) {
   188 	$language = preg_replace( '/[^a-zA-Z_]/', '', $_REQUEST['language'] );
   284 	$language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] );
   189 } elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
   285 } elseif ( isset( $GLOBALS['wp_local_package'] ) ) {
   190 	$language = $GLOBALS['wp_local_package'];
   286 	$language = $GLOBALS['wp_local_package'];
   191 }
   287 }
   192 
   288 
       
   289 $scripts_to_print = array( 'jquery' );
       
   290 
   193 switch($step) {
   291 switch($step) {
   194 	case 0: // Step 0
   292 	case 0: // Step 0
   195 
       
   196 		if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
   293 		if ( wp_can_install_language_pack() && empty( $language ) && ( $languages = wp_get_available_translations() ) ) {
       
   294 			$scripts_to_print[] = 'language-chooser';
   197 			display_header( 'language-chooser' );
   295 			display_header( 'language-chooser' );
   198 			echo '<form id="setup" method="post" action="?step=1">';
   296 			echo '<form id="setup" method="post" action="?step=1">';
   199 			wp_install_language_form( $languages );
   297 			wp_install_language_form( $languages );
   200 			echo '</form>';
   298 			echo '</form>';
   201 			break;
   299 			break;
   210 				load_default_textdomain( $loaded_language );
   308 				load_default_textdomain( $loaded_language );
   211 				$GLOBALS['wp_locale'] = new WP_Locale();
   309 				$GLOBALS['wp_locale'] = new WP_Locale();
   212 			}
   310 			}
   213 		}
   311 		}
   214 
   312 
       
   313 		$scripts_to_print[] = 'user-profile';
       
   314 
   215 		display_header();
   315 		display_header();
   216 ?>
   316 ?>
   217 <h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
   317 <h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
   218 <p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>
   318 <p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>
   219 
   319 
   220 <h1><?php _e( 'Information needed' ); ?></h1>
   320 <h2><?php _e( 'Information needed' ); ?></h2>
   221 <p><?php _e( 'Please provide the following information. Don&#8217;t worry, you can always change these settings later.' ); ?></p>
   321 <p><?php _e( 'Please provide the following information. Don&#8217;t worry, you can always change these settings later.' ); ?></p>
   222 
   322 
   223 <?php
   323 <?php
   224 		display_setup_form();
   324 		display_setup_form();
   225 		break;
   325 		break;
   232 		}
   332 		}
   233 
   333 
   234 		if ( ! empty( $wpdb->error ) )
   334 		if ( ! empty( $wpdb->error ) )
   235 			wp_die( $wpdb->error->get_error_message() );
   335 			wp_die( $wpdb->error->get_error_message() );
   236 
   336 
       
   337 		$scripts_to_print[] = 'user-profile';
       
   338 
   237 		display_header();
   339 		display_header();
   238 		// Fill in the data we gathered
   340 		// Fill in the data we gathered
   239 		$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
   341 		$weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
   240 		$user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
   342 		$user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
   241 		$admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : '';
   343 		$admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : '';
   242 		$admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : '';
   344 		$admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : '';
   243 		$admin_email  = isset( $_POST['admin_email'] ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : '';
   345 		$admin_email  = isset( $_POST['admin_email'] ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : '';
   244 		$public       = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0;
   346 		$public       = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1;
   245 
   347 
   246 		// Check e-mail address.
   348 		// Check email address.
   247 		$error = false;
   349 		$error = false;
   248 		if ( empty( $user_name ) ) {
   350 		if ( empty( $user_name ) ) {
   249 			// TODO: poka-yoke
   351 			// TODO: poka-yoke
   250 			display_setup_form( __( 'Please provide a valid username.' ) );
   352 			display_setup_form( __( 'Please provide a valid username.' ) );
   251 			$error = true;
   353 			$error = true;
   271 			$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
   373 			$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
   272 ?>
   374 ?>
   273 
   375 
   274 <h1><?php _e( 'Success!' ); ?></h1>
   376 <h1><?php _e( 'Success!' ); ?></h1>
   275 
   377 
   276 <p><?php _e( 'WordPress has been installed. Were you expecting more steps? Sorry to disappoint.' ); ?></p>
   378 <p><?php _e( 'WordPress has been installed. Thank you, and enjoy!' ); ?></p>
   277 
   379 
   278 <table class="form-table install-success">
   380 <table class="form-table install-success">
   279 	<tr>
   381 	<tr>
   280 		<th><?php _e( 'Username' ); ?></th>
   382 		<th><?php _e( 'Username' ); ?></th>
   281 		<td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td>
   383 		<td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td>
   289 			<p><?php echo $result['password_message'] ?></p>
   391 			<p><?php echo $result['password_message'] ?></p>
   290 		</td>
   392 		</td>
   291 	</tr>
   393 	</tr>
   292 </table>
   394 </table>
   293 
   395 
   294 <p class="step"><a href="../wp-login.php" class="button button-large"><?php _e( 'Log In' ); ?></a></p>
   396 <p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>" class="button button-large"><?php _e( 'Log In' ); ?></a></p>
   295 
   397 
   296 <?php
   398 <?php
   297 		}
   399 		}
   298 		break;
   400 		break;
   299 }
   401 }
   300 if ( !wp_is_mobile() ) {
   402 
   301 ?>
   403 if ( ! wp_is_mobile() ) {
       
   404 	?>
   302 <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
   405 <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script>
   303 <?php } ?>
   406 	<?php
   304 <?php wp_print_scripts( 'user-profile' ); ?>
   407 }
   305 <?php wp_print_scripts( 'language-chooser' ); ?>
   408 
       
   409 wp_print_scripts( $scripts_to_print );
       
   410 ?>
       
   411 <script type="text/javascript">
       
   412 jQuery( function( $ ) {
       
   413 	$( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' );
       
   414 } );
       
   415 </script>
   306 </body>
   416 </body>
   307 </html>
   417 </html>