You are here

function commerce_order_validate_number_characters in Commerce Core 7

Validates an order number string for acceptable characters.

Parameters

$order_number: The order number string to validate.

Return value

TRUE or FALSE indicating whether or not the order number contains valid characters.

File

modules/order/commerce_order.module, line 967
Defines the core Commerce order entity and API functions to manage orders and interact with them.

Code

function commerce_order_validate_number_characters($order_number) {
  return preg_match('!^[A-Za-z0-9_-]+$!', $order_number);
}