diff --git a/wp-admin/install.php b/wp-admin/install.php index 0e9b87b902..558bef8487 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -9,78 +9,84 @@ /** * We are installing WordPress. * - * @since unknown + * @since 1.5.1 * @var bool */ -define('WP_INSTALLING', true); +define( 'WP_INSTALLING', true ); /** Load WordPress Bootstrap */ -require_once(dirname(dirname(__FILE__)) . '/wp-load.php'); +require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); /** Load WordPress Administration Upgrade API */ -require_once(dirname(__FILE__) . '/includes/upgrade.php'); +require_once( dirname( __FILE__ ) . '/includes/upgrade.php' ); -if (isset($_GET['step'])) - $step = $_GET['step']; -else - $step = 0; +$step = isset( $_GET['step'] ) ? $_GET['step'] : 0; /** * Display install header. * - * @since unknown + * @since 2.5.0 * @package WordPress * @subpackage Installer */ function display_header() { -header( 'Content-Type: text/html; charset=utf-8' ); + header( 'Content-Type: text/html; charset=utf-8' ); ?> > - <?php _e('WordPress › Installation'); ?> + <?php _e( 'WordPress › Installation' ); ?>

WordPress

-

ERROR: %s'), $error); ?>

+

ERROR: %s' ), $error ); ?>

- - + + - - + + - +

-

+
-

+

'.__('Already Installed').'

'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'

');} +if ( is_blog_installed() ) { + display_header(); + die( '

' . __( 'Already Installed' ) . '

' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '

' ); +} $php_version = phpversion(); $mysql_version = $wpdb->db_version(); @@ -100,68 +106,66 @@ if ( !$mysql_compat || !$php_compat ) { } switch($step) { - case 0: - case 1: // in case people are directly linking to this + case 0: // Step 1 + case 1: // Step 1, direct link. display_header(); ?> -

-

ReadMe documentation at your leisure. Otherwise, just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?>

- - -

-

- +

+

ReadMe documentation at your leisure. Otherwise, just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ), '../readme.html' ); ?>

+

+

error) ) - wp_die($wpdb->error->get_error_message()); + if ( ! empty( $wpdb->error ) ) + wp_die( $wpdb->error->get_error_message() ); display_header(); // Fill in the data we gathered - $weblog_title = isset($_POST['weblog_title']) ? stripslashes($_POST['weblog_title']) : ''; - $admin_email = isset($_POST['admin_email']) ? stripslashes($_POST['admin_email']) : ''; - $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0; + $weblog_title = isset( $_POST['weblog_title'] ) ? stripslashes( $_POST['weblog_title'] ) : ''; + $admin_email = isset( $_POST['admin_email'] ) ? stripslashes( $_POST['admin_email'] ) : ''; + $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; // check e-mail address $error = false; - if (empty($admin_email)) { + if ( empty( $admin_email ) ) { // TODO: poka-yoke - display_setup_form( __('you must provide an e-mail address.') ); + display_setup_form( __( 'you must provide an e-mail address.' ) ); $error = true; - } else if (!is_email($admin_email)) { + } elseif ( ! is_email( $admin_email ) ) { // TODO: poka-yoke - display_setup_form( __('that isn’t a valid e-mail address. E-mail addresses look like: username@example.com') ); + display_setup_form( __( 'that isn’t a valid e-mail address. E-mail addresses look like: username@example.com' ) ); $error = true; } if ( $error === false ) { $wpdb->show_errors(); - $result = wp_install($weblog_title, 'admin', $admin_email, $public); - extract($result, EXTR_SKIP); + $result = wp_install( $weblog_title, 'admin', $admin_email, $public ); + extract( $result, EXTR_SKIP ); ?> -

+

-

+

- + - - + +
admin
'. $password .'
'; - } - echo '

'. $password_message .'

'; ?>
$password
"; + echo "

$password_message

"; ?> +
-

+