In user model where the validation of min and max password length is done there is an error with throwing 'warden.validation.password.too_short' exception. There is one ")" to much when passing parameters to \Orm\ValidationFailed!
Current code:
if (!empty($this->password)) {
if (\Str::length($this->password) < $min_length) {
throw new \Orm\ValidationFailed(__('warden.validation.password.too_short'), array('count' => $min_length));
} elseif (\Str::length($this->password) > $max_length) {
throw new \Orm\ValidationFailed(__('warden.validation.password.too_long', array('count' => $max_length)));
}
$this->encrypted_password = Warden::encrypt_password($this->password);
}
Fixed code:
if (!empty($this->password)) {
if (\Str::length($this->password) < $min_length) {
throw new \Orm\ValidationFailed(__('warden.validation.password.too_short', array('count' => $min_length));
} elseif (\Str::length($this->password) > $max_length) {
throw new \Orm\ValidationFailed(__('warden.validation.password.too_long', array('count' => $max_length)));
}
$this->encrypted_password = Warden::encrypt_password($this->password);
}
Notice the ")" in current code when throwing 'warden.validation.password.too_short'
The above code in current Warden trowed this Exception:
ErrorException [ Error ]: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])
PKGPATH/orm/classes/observer/validation.php @ line 35
In user model where the validation of min and max password length is done there is an error with throwing 'warden.validation.password.too_short' exception. There is one ")" to much when passing parameters to \Orm\ValidationFailed!
Current code:
Fixed code:
Notice the ")" in current code when throwing 'warden.validation.password.too_short'
The above code in current Warden trowed this Exception:
ErrorException [ Error ]: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) PKGPATH/orm/classes/observer/validation.php @ line 35
BR Primoz