From 49f9d0097f92966d8d09cb8eb05708425ea3e5ab Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 5 Jan 2020 17:13:52 +0100 Subject: [PATCH] fix podcast redirection --- www/deredirect.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.30.2