- changed version name;
This commit is contained in:
nikitasinelnikov
2021-04-15 14:17:16 +03:00
parent 096802cb5b
commit 73105dc2d1
3 changed files with 9 additions and 3 deletions
+3 -2
View File
@@ -19,6 +19,7 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
*/
function __construct() {
$this->regex_safe = '/\A[\w\-\.]+\z/';
$this->regex_username_safe = '|[^a-z0-9 _.\-@]|i';
$this->regex_phone_number = '/\A[\d\-\.\+\(\)\ ]+\z/';
@@ -214,12 +215,12 @@ if ( ! class_exists( 'um\core\Validation' ) ) {
* }
* ?>
*/
$regex_safe_username = apply_filters('um_validation_safe_username_regex',$this->regex_safe );
$regex_safe_username = apply_filters( 'um_validation_safe_username_regex', $this->regex_username_safe );
if ( is_email( $string ) ) {
return true;
}
if ( ! is_email( $string ) && ! preg_match( $regex_safe_username, $string ) ) {
if ( ! is_email( $string ) && preg_match( $regex_safe_username, $string ) ) {
return false;
}
return true;