fix podcast redirection
authorChristian Weiske <cweiske@cweiske.de>
Sun, 5 Jan 2020 16:13:52 +0000 (17:13 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 5 Jan 2020 16:15:49 +0000 (17:15 +0100)
www/deredirect.php

index 5b90e1d..a8c630b 100644 (file)
@@ -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;
 }