From: Christian Weiske Date: Sun, 5 Jan 2020 16:13:52 +0000 (+0100) Subject: fix podcast redirection X-Git-Url: https://git.cweiske.de/noxon-gateway.git/commitdiff_plain/49f9d0097f92966d8d09cb8eb05708425ea3e5ab?ds=sidebyside fix podcast redirection --- diff --git a/www/deredirect.php b/www/deredirect.php index 5b90e1d..a8c630b 100644 --- a/www/deredirect.php +++ b/www/deredirect.php @@ -17,7 +17,10 @@ function getFinalUrl($url) //get_headers follows redirects automatically $headers = get_headers($url, 1); if ($headers !== false && isset($headers['Location'])) { - return end($headers['Location']); + if (is_array($headers['Location'])) { + return end($headers['Location']); + } + return $headers['Location']; } return $url; }