|
@@ 1046-1053 (lines=8) @@
|
| 1043 |
|
$isbnn = ISBN::_normaliseISBN($isbnin); |
| 1044 |
|
/* input is ok now, let's convert */ |
| 1045 |
|
switch(true) { |
| 1046 |
|
case $verfrom == ISBN_VERSION_ISBN_10 && $verto == ISBN_VERSION_ISBN_13: |
| 1047 |
|
/* convert 10 to 13 */ |
| 1048 |
|
$isbnbody = ISBN::_extractISBNBody($isbnn); |
| 1049 |
|
if ($isbnbody === false) { |
| 1050 |
|
return false; |
| 1051 |
|
} |
| 1052 |
|
$isbnout = '978' . $isbnbody . ISBN::_checkdigitISBN13($isbnbody); |
| 1053 |
|
return $isbnout; |
| 1054 |
|
case $verfrom == ISBN_VERSION_ISBN_13 && $verto == ISBN_VERSION_ISBN_10: |
| 1055 |
|
/* convert 13 to 10 */ |
| 1056 |
|
$isbnbody = ISBN::_extractISBNBody($isbnn); |
|
@@ 1054-1061 (lines=8) @@
|
| 1051 |
|
} |
| 1052 |
|
$isbnout = '978' . $isbnbody . ISBN::_checkdigitISBN13($isbnbody); |
| 1053 |
|
return $isbnout; |
| 1054 |
|
case $verfrom == ISBN_VERSION_ISBN_13 && $verto == ISBN_VERSION_ISBN_10: |
| 1055 |
|
/* convert 13 to 10 */ |
| 1056 |
|
$isbnbody = ISBN::_extractISBNBody($isbnn); |
| 1057 |
|
if ($isbnbody === false) { |
| 1058 |
|
return false; |
| 1059 |
|
} |
| 1060 |
|
$isbnout = $isbnbody . ISBN::_checkdigitISBN10($isbnbody); |
| 1061 |
|
return $isbnout; |
| 1062 |
|
case $verfrom == $verto: |
| 1063 |
|
/* version is the same so there is no need to convert */ |
| 1064 |
|
/* hej, praktisch! */ |