Modified null and empty string check.
This commit is contained in:
parent
f8d7732025
commit
52cb3cb980
@ -222,10 +222,7 @@ namespace Oqtane.Shared
|
|||||||
|
|
||||||
public static bool IsValidEmail(string email)
|
public static bool IsValidEmail(string email)
|
||||||
{
|
{
|
||||||
if (email != "")
|
if (string.IsNullOrEmpty(email)) return false;
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Regex.IsMatch(email,
|
return Regex.IsMatch(email,
|
||||||
@"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
|
@"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user