[Koha-patches] [PATCH] fix to C4::Koha::_isbn_cleanup

Galen Charlton galen.charlton at liblime.com
Thu Apr 30 20:06:24 CEST 2009


Both valid ISBN-10s and -13s can use 'X' as a checkdigit
value.
---
 C4/Koha.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/C4/Koha.pm b/C4/Koha.pm
index 418b815..b4ce84b 100644
--- a/C4/Koha.pm
+++ b/C4/Koha.pm
@@ -1206,10 +1206,11 @@ sub _normalize_match_point {
 sub _isbn_cleanup ($) {
     my $normalized_isbn = shift;
     $normalized_isbn =~ s/-//g;
-    $normalized_isbn =~/([0-9]{1,})/;
+    $normalized_isbn =~/([0-9x]{1,})/i;
     $normalized_isbn = $1;
     if (
         $normalized_isbn =~ /\b(\d{13})\b/ or
+        $normalized_isbn =~ /\b(\d{12})\b/i or
         $normalized_isbn =~ /\b(\d{10})\b/ or
         $normalized_isbn =~ /\b(\d{9}X)\b/i
     ) { 
-- 
1.5.6.5




More information about the Koha-patches mailing list