From 7d57483086e5f5b69bbba1934bba860153ad8db7 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Tue, 11 Apr 2023 10:17:35 +0700 Subject: [PATCH] Show correct info about password requirements (#676) --- library/includes/ucp/register.php | 1 + library/language/source/main.php | 2 +- styles/templates/default/usercp_register.tpl | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php index cd17aea31..4296d63cb 100644 --- a/library/includes/ucp/register.php +++ b/library/includes/ucp/register.php @@ -654,6 +654,7 @@ $template->assign_vars(array( 'EDIT_PROFILE' => ($mode == 'editprofile'), 'ADM_EDIT' => $adm_edit, 'SHOW_PASS' => ($adm_edit || ($mode == 'register' && IS_ADMIN)), + 'PASSWORD_LONG' => sprintf($lang['PASSWORD_LONG'], PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH), 'CAPTCHA_HTML' => ($need_captcha) ? bb_captcha('get') : '', 'LANGUAGE_SELECT' => \TorrentPier\Legacy\Select::language($pr_data['user_lang'], 'user_lang'), diff --git a/library/language/source/main.php b/library/language/source/main.php index 56dea8e1e..6866b8787 100644 --- a/library/language/source/main.php +++ b/library/language/source/main.php @@ -615,7 +615,7 @@ $lang['PROFILE_UPDATED_INACTIVE'] = 'Your profile has been updated. However, you $lang['PASSWORD_MISMATCH'] = 'The passwords you entered did not match.'; $lang['CURRENT_PASSWORD_MISMATCH'] = 'The current password you supplied does not match that stored in the database.'; -$lang['PASSWORD_LONG'] = 'Your password must be no more than 32 characters.'; +$lang['PASSWORD_LONG'] = 'Your password must be no longer than %d characters and no shorter than %d characters.'; $lang['TOO_MANY_REGISTERS'] = 'You have made too many registration attempts. Please try again later.'; $lang['USERNAME_TAKEN'] = 'Sorry, but this username has already been taken.'; $lang['USERNAME_INVALID'] = 'Sorry, but this username contains an invalid character'; diff --git a/styles/templates/default/usercp_register.tpl b/styles/templates/default/usercp_register.tpl index 238ac91d2..209551714 100644 --- a/styles/templates/default/usercp_register.tpl +++ b/styles/templates/default/usercp_register.tpl @@ -80,7 +80,7 @@ document.write(''); {L_NEW_PASSWORD}: *
{L_PASSWORD_IF_CHANGED}
{L_PASSWORD}: *   -  {L_PASSWORD_LONG} +  {PASSWORD_LONG}