]> git.wh0rd.org - tt-rss.git/commitdiff
af_zz_imgproxy: redirect to caller url unless called in user context
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 10 Feb 2017 19:02:30 +0000 (22:02 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 10 Feb 2017 19:02:30 +0000 (22:02 +0300)
plugins/af_zz_imgproxy/init.php

index 5d9a96ac3335d994c31c89f2eeb3da4f62637b36..6d7954c3c955dd20f455e6b93b2076759b5dc17b 100644 (file)
@@ -35,6 +35,12 @@ class Af_Zz_ImgProxy extends Plugin {
                $url = rewrite_relative_url(SELF_URL_PATH, $_REQUEST["url"]);
                $kind = (int) $_REQUEST["kind"]; // 1 = video
 
+               // called without user context, let's just redirect to original URL
+               if (!$_SESSION["uid"]) {
+                       header("Location: $url");
+                       return;
+               }
+
                $extension = $kind == 1 ? '.mp4' : '.png';
                $local_filename = CACHE_DIR . "/images/" . sha1($url) . $extension;