WordPress.org

Make WordPress Core

Ticket #27740: 27740.2.diff

File 27740.2.diff, 1.4 KB (added by UmeshSingla, 6 years ago)

Cleaned up patch

  • wp-admin/install.php

     
    190190                // Fill in the data we gathered
    191191                $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
    192192                $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : '';
    193                 $admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : '';
    194                 $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : '';
     193                $admin_password = isset($_POST['admin_password']) ? trim( wp_unslash( $_POST['admin_password'] ) ) : '';
     194                $admin_password_check = isset($_POST['admin_password2']) ? trim( wp_unslash( $_POST['admin_password2'] ) ) : '';
    195195                $admin_email  = isset( $_POST['admin_email']  ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : '';
    196196                $public       = isset( $_POST['blog_public']  ) ? (int) $_POST['blog_public'] : 0;
    197197                // check e-mail address
     
    215215                        // TODO: poka-yoke
    216216                        display_setup_form( __( 'Sorry, that isn&#8217;t a valid email address. Email addresses look like <code>username@example.com</code>.' ) );
    217217                        $error = true;
     218                } elseif ( empty( $admin_password ) ) {
     219                        display_setup_form( __( 'Please provide a valid password.' ) );
     220                        $error = true;
    218221                }
    219222
    220223                if ( $error === false ) {