You are here

function sms_validate_number in SMS Framework 5

Same name and namespace in other branches
  1. 6.2 sms.module \sms_validate_number()
  2. 6 sms.module \sms_validate_number()
  3. 7 sms.module \sms_validate_number()
2 calls to sms_validate_number()
sms_sendtophone_form_validate in modules/sms_sendtophone/sms_sendtophone.module
sms_user_validate_number in modules/sms_user/sms_user.module

File

./sms.module, line 349
The core of the SMS Framework. Provides gateway managment and API for sending and receiving SMS messages.

Code

function sms_validate_number(&$number) {
  if (!strlen($number) || !($number = sms_formatter($number))) {
    return t('The phone number is invalid.');
  }

  // Allow the active gateway to provide number validation
  $gateway = sms_default_gateway();
  if (function_exists($gateway['validate number']) && ($error = $gateway['validate number']($number))) {
    return $error;
  }
}