You are here

function _securitytxt_valid_phone in Security.txt 7

Basic validator for telephone numbers.

1 call to _securitytxt_valid_phone()
securitytxt_file_form_validate in ./securitytxt.admin.inc
Security.txt file form validation.

File

./securitytxt.admin.inc, line 252

Code

function _securitytxt_valid_phone($phone) {
  $pattern = '/^[ext,\\d\\s\\-\\+]{5,30}$/';
  if (preg_match($pattern, $phone)) {
    return TRUE;
  }
  return FALSE;
}