Skip to content

Commit

Permalink
Handle other 4XX case in Google Lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
zuphilip committed May 19, 2019
1 parent 7abcbe8 commit 13c304a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion isbn/verkaufsinfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function isbn13($z)

$urlGoogle = "https://www.googleapis.com/books/v1/volumes?q=ISBN:$n13";
$headerGoogle = get_headers($urlGoogle, 1);
$foundOnGoogle = !strpos($headerGoogle[0], '404 NotFound');
$foundOnGoogle = !strpos($headerGoogle[0], '404 NotFound') && !strpos($headerGoogle[0], '403 Forbidden');

if ($foundOnGoogle) {
$contentGoogle = file_get_contents($urlGoogle);
Expand Down

0 comments on commit 13c304a

Please sign in to comment.