consolidate email validation checks

This commit is contained in:
zotlabs
2017-05-11 19:01:04 -07:00
parent 4f577cbdeb
commit 1de1b58a08
5 changed files with 3 additions and 28 deletions

View File

@@ -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.
*