Changeset 29006 for trunk/src/wp-admin/setup-config.php
- Timestamp:
- 07/05/2014 05:13:05 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/setup-config.php
r29005 r29006 27 27 * Set this to error_reporting( -1 ) for debugging 28 28 */ 29 error_reporting( -1);29 error_reporting(0); 30 30 31 31 define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); 32 32 33 33 require( ABSPATH . 'wp-settings.php' ); 34 35 require( ABSPATH . 'wp-admin/includes/upgrade.php' ); 34 36 35 37 // Support wp-config-sample.php one level up, for the develop repo. … … 49 51 wp_die( '<p>' . sprintf( __( "The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>."), 'install.php' ) . '</p>' ); 50 52 51 $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0;53 $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; 52 54 53 55 /** … … 57 59 * @since 2.3.0 58 60 */ 59 function setup_config_display_header( ) {61 function setup_config_display_header( $body_classes = array() ) { 60 62 global $wp_version; 63 $body_classes = (array) $body_classes; 64 $body_classes[] = 'wp-core-ui'; 65 if ( is_rtl() ) { 66 $body_classes[] = 'rtl'; 67 } 61 68 62 69 header( 'Content-Type: text/html; charset=utf-8' ); … … 72 79 73 80 </head> 74 <body class=" wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>">81 <body class="<?php echo implode( ' ', $body_classes ); ?>"> 75 82 <h1 id="logo"><a href="<?php esc_attr_e( 'https://wordpress.org/' ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></h1> 76 83 <?php … … 78 85 79 86 switch($step) { 87 case -1: 88 89 if ( empty( $_GET['language'] ) && ( $body = wp_get_available_translations() ) ) { 90 setup_config_display_header( 'language-chooser' ); 91 echo '<form id="setup" method="post" action="?step=0">'; 92 wp_install_language_form( $body ); 93 echo '</form>'; 94 break; 95 } 96 97 // Deliberately fall through if we can't reach the translations API. 98 80 99 case 0: 100 if ( ! empty( $_REQUEST['language'] ) ) { 101 $loaded_language = wp_install_download_language_pack( $_REQUEST['language'] ); 102 if ( $loaded_language ) { 103 wp_install_load_language( $loaded_language ); 104 } 105 } 106 81 107 setup_config_display_header(); 108 $step_1 = 'setup-config.php?step=1'; 109 if ( isset( $_REQUEST['noapi'] ) ) { 110 $step_1 .= '&noapi'; 111 } 112 if ( ! empty( $loaded_language ) ) { 113 $step_1 .= '&language=' . $loaded_language; 114 } 82 115 ?> 83 116 … … 97 130 <p><?php _e( "In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you’re all ready…" ); ?></p> 98 131 99 <p class="step"><a href=" setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&noapi'; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p>132 <p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p> 100 133 <?php 101 134 break; 102 135 103 136 case 1: 137 $loaded_language = wp_install_load_language( $_REQUEST['language'] ); 104 138 setup_config_display_header(); 105 139 ?> … … 134 168 </table> 135 169 <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="1" /><?php } ?> 170 <input type="hidden" name="language" value="<?php echo esc_attr( $loaded_language ); ?>" /> 136 171 <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p> 137 172 </form> … … 140 175 141 176 case 2: 177 $loaded_language = wp_install_load_language( $_REQUEST['language'] ); 142 178 $dbname = trim( wp_unslash( $_POST[ 'dbname' ] ) ); 143 179 $uname = trim( wp_unslash( $_POST[ 'uname' ] ) ); … … 146 182 $prefix = trim( wp_unslash( $_POST[ 'prefix' ] ) ); 147 183 148 $tryagain_link = '</p><p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try again' ) . '</a>'; 184 $step_1 = 'setup-config.php?step=1'; 185 $install = 'install.php'; 186 if ( isset( $_REQUEST['noapi'] ) ) { 187 $step_1 .= '&noapi'; 188 } 189 if ( $loaded_language ) { 190 $step_1 .= '&language=' . $loaded_language; 191 $install .= '?language=' . $loaded_language; 192 } 193 $tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try again' ) . '</a>'; 149 194 150 195 if ( empty( $prefix ) ) … … 240 285 ?></textarea> 241 286 <p><?php _e( 'After you’ve done that, click “Run the install.”' ); ?></p> 242 <p class="step"><a href=" install.php" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>287 <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the install' ); ?></a></p> 243 288 <script> 244 289 (function(){ … … 267 312 <p><?php _e( "All right, sparky! You’ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…" ); ?></p> 268 313 269 <p class="step"><a href=" install.php" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>314 <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the install' ); ?></a></p> 270 315 <?php 271 316 endif;
Note: See TracChangeset
for help on using the changeset viewer.