Skip to content

Commit 6ef2a09

Browse files
committed
Suppress connection errors in log
1 parent 40d31fc commit 6ef2a09

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

isbn/dnb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
$suchString = 'dnb.num=' . implode('+OR+dnb.num=', $nArray);
4848
}
4949

50-
$result = file_get_contents($urlBase . $suchString, false);
50+
$result = @file_get_contents($urlBase . $suchString, false);
5151

5252
if ($result === false) {
5353
header('HTTP/1.1 400 Bad Request');

isbn/verkaufsinfo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188

189189
if (!isset($cover)) {
190190
$urlOpenlibrary = 'https://covers.openlibrary.org/b/isbn/' . $n13 . '-M.jpg';
191-
$headerOpenlibrary = get_headers($urlOpenlibrary, 1);
192-
if (!strpos($headerOpenlibrary[0], '404 NotFound')) {
191+
$headerOpenlibrary = @get_headers($urlOpenlibrary, 1);
192+
if ($headerOpenlibrary !== false && !strpos($headerOpenlibrary[0], '404 NotFound')) {
193193
$cover = $urlOpenlibrary;
194194
$coverOrigin = 'https://openlibrary.org/isbn/' . $n13;
195195
}

0 commit comments

Comments
 (0)