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 <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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;