Skip to content

Commit

Permalink
Merge branch 'lasselehtinen-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Dec 9, 2023
2 parents c0af56c + 77b9a93 commit d3ab528
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Rules/Isbn.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function passes($attribute, $value)
case 10:
return $this->shortChecksumMatches($value);

case 13:
return parent::checksumMatches($value); // isbn-13 is a subset of ean-13
case 13: // isbn-13 is a subset of ean-13
return preg_match("/^(978|979)/", $value) && parent::checksumMatches($value);
}

return false;
Expand Down
4 changes: 3 additions & 1 deletion tests/Rules/IsbnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function dataProvider()
[false, 'ABC'],
[false, '978-0-306-40615-6'],
[false, '99921-58-10-6'],
[false, '0123456789012'],
];
}

Expand Down Expand Up @@ -122,6 +123,7 @@ public function dataProviderLong()
[false, 'ABC'],
[false, '978-0-306-40615-6'],
[false, '99921-58-10-6'],
[false, '0123456789012'],
];
}
}
}

0 comments on commit d3ab528

Please sign in to comment.