mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 19:54:24 +02:00
Fix issue processwire/processwire-issues#432
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* An Inputfield for handling a password
|
||||
*
|
||||
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
||||
* ProcessWire 3.x, Copyright 2019 by Ryan Cramer
|
||||
* https://processwire.com
|
||||
*
|
||||
* @property array $requirements Array of requirements (See require* constants)
|
||||
@@ -301,14 +301,16 @@ class InputfieldPassword extends InputfieldText {
|
||||
$key = $this->attr('name');
|
||||
$value = $this->attr('value');
|
||||
if($value) {}
|
||||
$confirmKey = "_" . $key;
|
||||
|
||||
if(!isset($input->$key)) return $this;
|
||||
|
||||
// form was submitted
|
||||
$pass = $input->$key;
|
||||
$confirmPass = $input->$confirmKey;
|
||||
|
||||
if(strlen($pass)) {
|
||||
// password was submitted
|
||||
if(strlen($pass) && strlen($confirmPass)) {
|
||||
// password was submitted (with confirmation)
|
||||
$allowInput = true;
|
||||
|
||||
if($this->requireOld > 0 && $user->isLoggedin()) {
|
||||
@@ -325,8 +327,7 @@ class InputfieldPassword extends InputfieldText {
|
||||
}
|
||||
|
||||
if($allowInput) {
|
||||
$confirmKey = "_" . $key;
|
||||
if($input->$confirmKey != $pass) {
|
||||
if($confirmPass !== $pass) {
|
||||
$this->error($this->_("Passwords do not match"));
|
||||
}
|
||||
$this->isValidPassword($pass);
|
||||
|
Reference in New Issue
Block a user