consolidate email validation checks
This commit is contained in:
@@ -1042,19 +1042,6 @@ function searchbox($s,$id='search-box',$url='/search',$save = false) {
|
||||
));
|
||||
}
|
||||
|
||||
function valid_email_regex($x){
|
||||
if(preg_match('/^[_a-zA-Z0-9\-\+]+(\.[_a-zA-Z0-9\-\+]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+$/',$x))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function valid_email($x){
|
||||
if(get_config('system','disable_email_validation'))
|
||||
return true;
|
||||
|
||||
return valid_email_regex($x);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Replace naked text hyperlink with HTML formatted hyperlink.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user