public function ISBNtest::valid_isbn13 in Biblio Advanced Import 6
Same name and namespace in other branches
- 7 lib/isbntest.class.php \ISBNtest::valid_isbn13()
3 calls to ISBNtest::valid_isbn13()
File
- lib/
isbntest.class.php, line 204
Class
Code
public function valid_isbn13($isbn = "") {
if ($isbn != "") {
// if we've been given an isbn here, use it
$this
->set_isbn13($isbn);
}
if (FALSE === $this->isbn13 && FALSE !== $this->isbn10) {
if (TRUE === $this
->valid_isbn10()) {
$this
->get_isbn13();
}
}
if (FALSE === $this->isbn13 || strlen($this->isbn13) != 13) {
$this->error = "ISBN-13 is not set";
return FALSE;
}
if ((string) substr($this->isbn13, 12, 1) === (string) $this
->get_isbn13_checkdigit()) {
return TRUE;
}
else {
$this->error = "Checkdigit failure";
return FALSE;
}
}