From 78994d2ddaff12d7e196b4fb213311d6da8620d1 Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 15 Jan 2015 22:42:52 +0000 Subject: [PATCH] Bug 10177 - Whitespace is accepted within the password but leading and trailing spaces are not. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test plan: 1: Go to your patron 2: Go to change username and/or password. 3: Change password to something with spaces in the middle. Notice it is invalid. 4: Apply this patch. 5: Change password again using spaces in the middle. Notice it is accepted. 6: Change password with leading and/or trailing spaces, notice they are not accepted. Applied bothe patches. Followed test plan. Patch behaves as expected. Signed-off-by: Marc VĂ©ron Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../intranet-tmpl/prog/en/modules/members/member-password.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt index 6d27ad3cda..4cb04ef5d7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt @@ -9,8 +9,8 @@ alert(_("Passwords do not match")); return false; } else { - if ($("input[name='newpassword']").val().match(/^\s*$/)) { - alert(_("Password contains nothing except whitespace")); + if ($("input[name='newpassword']").val().match(/^\s/) || $("input[name='newpassword']").val().match(/\s$/)) { + alert(_("Password contains leading and/or trailing spaces.")); return false; } else { return true;