WordPress.org

Make WordPress Core

Ticket #19786: 19786.diff

File 19786.diff, 3.0 KB (added by Caspie, 2 years ago)
  • wp-admin/install.php

     
    3939require_once( dirname( __FILE__ ) . '/includes/upgrade.php' ); 
    4040 
    4141/** Load wpdb */ 
    42 require_once(dirname(dirname(__FILE__)) . '/wp-includes/wp-db.php'); 
     42require_once( dirname( dirname( __FILE__ ) ) . '/wp-includes/wp-db.php' ); 
    4343 
    44 $step = isset( $_GET['step'] ) ? $_GET['step'] : 0; 
     44$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; 
    4545 
    4646/** 
    4747 * Display install header. 
     
    183183                display_header(); 
    184184                // Fill in the data we gathered 
    185185                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : ''; 
    186                 $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; 
    187                 $admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : ''; 
    188                 $admin_password_check = isset($_POST['admin_password2']) ? $_POST['admin_password2'] : ''; 
    189                 $admin_email  = isset( $_POST['admin_email']  ) ?trim( stripslashes( $_POST['admin_email'] ) ) : ''; 
    190                 $public       = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; 
     186                $user_name = isset( $_POST['user_name'] ) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin'; 
     187                $admin_password = isset( $_POST['admin_password'] ) ? $_POST['admin_password'] : ''; 
     188                $admin_password_check = isset( $_POST['admin_password2'] ) ? $_POST['admin_password2'] : ''; 
     189                $admin_email = isset( $_POST['admin_email'] ) ? trim( stripslashes( $_POST['admin_email'] ) ) : ''; 
     190                $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 0; 
    191191                // check e-mail address 
    192192                $error = false; 
    193193                if ( empty( $user_name ) ) { 
    194194                        // TODO: poka-yoke 
    195                         display_setup_form( __('you must provide a valid username.') ); 
     195                        display_setup_form( __( 'you must provide a valid username.' ) ); 
    196196                        $error = true; 
    197197                } elseif ( $user_name != sanitize_user( $user_name, true ) ) { 
    198                         display_setup_form( __('the username you provided has invalid characters.') ); 
     198                        display_setup_form( __( 'the username you provided has invalid characters.' ) ); 
    199199                        $error = true; 
    200200                } elseif ( $admin_password != $admin_password_check ) { 
    201201                        // TODO: poka-yoke 
  • wp-admin/setup-config.php

     
    6262if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php')) 
    6363        wp_die("<p>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>.</p>"); 
    6464 
    65 if (isset($_GET['step'])) 
    66         $step = $_GET['step']; 
    67 else 
    68         $step = 0; 
     65$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; 
    6966 
    7067/** 
    7168 * Display setup wp-config.php file header.