In com_users edit.php - the html helper password validation is not taking into account the password complexity that I have setup in the User backend. I have 12 chars minimum, upper, lower and special chars required.
The expected behavior is that the HTML Helper validation uses those settings to set the validation - however, all it does it look for 4 chars minimum.
I found this setting here: media/system/js/fields/validate.js
line 482:
this.setHandler('password', value => {
const regex = /^\S[\S ]{2,98}\S$/;
return regex.test(value);
If I change it to: const regex = /^(?=.*[A-Z].*[A-Z])(?=.*[!@#$&*])(?=.*[0-9].*[0-9])(?=.*[a-z].*[a-z].*[a-z]).{12,}$/;
It does not change the validation behavior on the page.
First - is this a bug? Second - how could I change this to enforce the regex for the password?
\d
rather than[0-9]
. I would probably use negated character classes rather than.
in the lookaheads. Is it possible that you were merely experiencing a js file caching problem while testing?