Add email address validation and RPC method to set email
This commit is contained in:
parent
3e3bcfd143
commit
2656becd25
2 changed files with 61 additions and 0 deletions
|
@ -18,6 +18,17 @@ class Validator
|
|||
return preg_match(self::PEER_ADDRESS_PATTERN, $address) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the provided email address is in a valid email format.
|
||||
*
|
||||
* @param string $emailAddress The email address to be validated.
|
||||
* @return bool Returns true if the email address is valid, otherwise false.
|
||||
*/
|
||||
public static function validateEmailAddress(string $emailAddress): bool
|
||||
{
|
||||
return filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates a username
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue