Merge pull request #18208 from liviuconcioiu/18093

Fix #18093 - Checks if username is defined
This commit is contained in:
Maurício Meneghini Fauth 2023-03-04 20:25:21 -03:00 committed by GitHub
commit 74a15b5f44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -516,7 +516,7 @@ Functions.checkPasswordStrength = function (value, meterObject, meterObjectLabel
'my',
'admin',
];
if (username !== null) {
if (username) {
customDict.push(username);
}
@ -584,7 +584,7 @@ Functions.suggestPassword = function (passwordForm) {
passwordForm.elements.pma_pw2.value = passwd.value;
var meterObj = $jQueryPasswordForm.find('meter[name="pw_meter"]').first();
var meterObjLabel = $jQueryPasswordForm.find('span[name="pw_strength"]').first();
Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel);
Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel, passwordForm.elements.username.value);
return true;
};