Account/Fixup

* fix referencing nonexistent error message if password validation fails
 * fixes #488
This commit is contained in:
Sarjuuk 2026-01-29 22:33:43 +01:00
parent 021cdf6228
commit 62d898173a
3 changed files with 3 additions and 3 deletions

View file

@ -99,7 +99,7 @@ class AccountSignupResponse extends TemplateResponse
// check password
if (!Util::validatePassword($this->_post['password'], $e))
return Lang::account($e == 1 ? 'errPassLength' : 'errPassChars');
return $e == 1 ? Lang::account('errPassLength') : Lang::main('intError');
if ($this->_post['password'] !== $this->_post['c_password'])
return Lang::account('passMismatch');

View file

@ -48,7 +48,7 @@ class AccountUpdatepasswordResponse extends TextResponse
return Lang::main('intError');
if (!Util::validatePassword($this->_post['newPassword'], $e))
return Lang::account($e == 1 ? 'errPassLength' : 'errPassChars');
return $e == 1 ? Lang::account('errPassLength') : Lang::main('intError');
if ($this->_post['newPassword'] !== $this->_post['confirmPassword'])
return Lang::account('passMismatch');

View file

@ -74,7 +74,7 @@ CLISetup::registerUtility(new class extends UtilityScript
$name = $uiAccount['name'];
if (!$passw && !Util::validatePassword($uiAccount['pass1'], $e))
CLI::write(Lang::account($e == 1 ? 'errPassLength' : 'errPassChars'), CLI::LOG_ERROR);
CLI::write($e == 1 ? Lang::account('errPassLength') : Lang::main('intError'), CLI::LOG_ERROR);
else if (!$passw && $uiAccount['pass1'] != $uiAccount['pass2'])
CLI::write(Lang::account('passMismatch'), CLI::LOG_ERROR);
else if (!$passw)