From 961b2eb5e4f674f1f0f51f47bbb683744c63f19c Mon Sep 17 00:00:00 2001 From: Spuds Date: Thu, 25 Apr 2024 13:49:15 -0500 Subject: [PATCH 1/3] ! close #3790 Password longer than 64 characters is accepted on registration --- sources/subs/Auth.subs.php | 9 ++++++++- themes/default/ProfileOptions.template.php | 1 + themes/default/Register.template.php | 3 ++- themes/default/Reminder.template.php | 4 +++- themes/default/languages/english/Errors.english.php | 3 ++- themes/default/languages/english/Login.english.php | 3 ++- themes/default/scripts/register.js | 5 ++++- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sources/subs/Auth.subs.php b/sources/subs/Auth.subs.php index 2405ef80b1..cb20cdeb4c 100644 --- a/sources/subs/Auth.subs.php +++ b/sources/subs/Auth.subs.php @@ -11,7 +11,7 @@ * copyright: 2011 Simple Machines (http://www.simplemachines.org) * license: BSD, See included LICENSE.TXT for terms and conditions. * - * @version 1.1.7 + * @version 1.1.10 * */ @@ -543,6 +543,13 @@ function validatePassword($password, $username, $restrict_in = array()) return 'short'; } + if (Util::strlen($password) > 64) + { + loadLanguage('Errors'); + $txt['profile_error_password_long'] = sprintf($txt['profile_error_password_long'], 64); + return 'short'; + } + // Is this enough? if (empty($modSettings['password_strength'])) return null; diff --git a/themes/default/ProfileOptions.template.php b/themes/default/ProfileOptions.template.php index e56d1fc062..7b7c9e7eca 100644 --- a/themes/default/ProfileOptions.template.php +++ b/themes/default/ProfileOptions.template.php @@ -1437,6 +1437,7 @@ function template_authentication_method()