Skip to content

Commit

Permalink
Fix crash when no location header is set for 302
Browse files Browse the repository at this point in the history
  • Loading branch information
ilpianista committed Sep 20, 2023
1 parent b1acd8b commit 9d2f1ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Favicon/Favicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ public function info($url)
switch ($status) {
case '301':
case '302':
$url = isset($headers['location']) ? $headers['location'] : '';
if (is_array($url)) {
$url = end($url);
if (isset($headers['location'])) {
$url = $headers['location'];
if (is_array($url)) {
$url = end($url);
}
} else {
return false;
}
break;
default:
Expand Down

0 comments on commit 9d2f1ce

Please sign in to comment.