WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/10/2020 04:49:35 PM (13 months ago)
Author:
adamsilverstein
Message:

Users: prevent saving empty passwords, trim space from password ends on save.

Fix an issue where users could save a password with only spaces, or spaces at the beginning or end of their password, preventing them from logging in.

Props ronakganatra, 1naveengiri, ajensen, oolleegg55, bookdude13, nrqsnchz, aristath.
Fixes #42766.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/user.php

    r49109 r49118  
    4848    $pass2 = '';
    4949    if ( isset( $_POST['pass1'] ) ) {
    50         $pass1 = $_POST['pass1'];
     50        $pass1 = trim( $_POST['pass1'] );
    5151    }
    5252    if ( isset( $_POST['pass2'] ) ) {
    53         $pass2 = $_POST['pass2'];
     53        $pass2 = trim( $_POST['pass2'] );
    5454    }
    5555
Note: See TracChangeset for help on using the changeset viewer.