Bug 10177 - whitespace is a valid password causing pernicious perturbations.
authorBrandon <brandon_h27@hotmail.com>
Wed, 14 Jan 2015 22:30:01 +0000 (22:30 +0000)
committerLiz Rea <wizzyrea@gmail.com>
Wed, 14 Oct 2015 03:18:06 +0000 (16:18 +1300)
Test plan:
Go to your patron, go to change username and/or password. change
password to whitespace, notice it is accepted, apply this patch,
change password again, to whitespace, notice password is not valid.

Followed test plan. Patch behaves as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt

index 96544e0..6d27ad3 100644 (file)
@@ -9,7 +9,12 @@
                 alert(_("Passwords do not match"));
                 return false;
             } else {
+                if ($("input[name='newpassword']").val().match(/^\s*$/)) {
+                  alert(_("Password contains nothing except whitespace"));
+                  return false;
+              } else {
                 return true;
+}
             }
         });
         $("body").on('click', "#fillrandom",function(e) {