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 5b90e1dfa6449111bf908fc006df5f14ed09f26d..a8c630b0d916ae22a1122aada947d1d61958a7c5 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;
 }