wsp-10285 Add the symbol “_” in the category of Non-alphanumeric symbols

This commit is contained in:
Alexander Trofimov 2015-01-17 01:32:10 +07:00
parent a231dd0464
commit fc37d5f310

View file

@ -220,7 +220,7 @@ namespace WebsitePanel.Portal
function wspValidatePasswordSymbols(source, args) function wspValidatePasswordSymbols(source, args)
{ {
if(args.Value == source.getAttribute('dpsw')) return true; if(args.Value == source.getAttribute('dpsw')) return true;
args.IsValid = wspValidatePattern(/(\W)/g, args.Value, args.IsValid = wspValidatePattern(/([\W_])/g, args.Value,
parseInt(source.getAttribute('minimumNumber'))); parseInt(source.getAttribute('minimumNumber')));
} }
@ -357,7 +357,7 @@ namespace WebsitePanel.Portal
protected void valRequireSymbols_ServerValidate(object source, ServerValidateEventArgs args) protected void valRequireSymbols_ServerValidate(object source, ServerValidateEventArgs args)
{ {
args.IsValid = ((args.Value == EMPTY_PASSWORD) || ValidatePattern("(\\W)", args.Value, MinimumSymbols)); args.IsValid = ((args.Value == EMPTY_PASSWORD) || ValidatePattern("([\\W_])", args.Value, MinimumSymbols));
} }
private bool ValidatePattern(string regexp, string val, int minimumNumber) private bool ValidatePattern(string regexp, string val, int minimumNumber)