Skip to content

Commit 6636a44

Browse files
authored
Merge pull request #563 from bcgov/yj
fix(dss-767)
2 parents ec6e68b + 122f9e9 commit 6636a44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/StrDss.Common/CommonUtils.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ public static string SanitizeAndUppercaseString(string input)
8181

8282
public static bool IsValidEmailAddress(string email)
8383
{
84+
if (string.IsNullOrWhiteSpace(email)) return false;
85+
8486
var valid = Regex.IsMatch(email, RegexDefs.GetRegexInfo(RegexDefs.Email).Regex);
8587

8688
if (!valid) return false;
8789

88-
if (email.StartsWith(".") || email.Contains(".@")) return false;
90+
if (email.StartsWith(".") || email.EndsWith(".") || email.Contains(".@") || email.Contains("@.")) return false;
8991

9092
return true;
9193
}

0 commit comments

Comments
 (0)