WordPress.org

Make WordPress Core

Ticket #42766: 42766.2.diff

File 42766.2.diff, 539 bytes (added by 1naveengiri, 4 years ago)

@adamsilverstein trimming is better here, as you know spaces are not considered as empty. I have removed that error, your point seems meaningful to me here.

  • wp-admin/includes/user.php

    diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php
    index 269d64fb26..30f29a42ba 100644
    a b function edit_user( $user_id = 0 ) { 
    4545
    4646        $pass1 = $pass2 = '';
    4747        if ( isset( $_POST['pass1'] ) ) {
    48                 $pass1 = $_POST['pass1'];
     48                $pass1 = trim( $_POST['pass1'] );
    4949        }
    5050        if ( isset( $_POST['pass2'] ) ) {
    51                 $pass2 = $_POST['pass2'];
     51                $pass2 = trim( $_POST['pass2'] );
    5252        }
    5353
    5454        if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) {