You are here

function isbn_validate_13 in ISBN Field 6

File

./isbn.module, line 74
Defines ISBN field types.

Code

function isbn_validate_13($string) {
  $return['valid'] = _isbn_validate_13($string);

  //Invalidate if not 978 or 979
  $prefix = substr($string, 0, 3);
  if ($prefix !== "978" && $prefix !== "979") {
    $return['valid'] = false;
    $return['message'] = 'missingPrefix13';
  }
  return $return;
}