af_zz_imgproxy: redirect to caller url unless called in user context
This commit is contained in:
parent
4daaf23491
commit
2187322cae
|
@ -35,6 +35,12 @@ class Af_Zz_ImgProxy extends Plugin {
|
||||||
$url = rewrite_relative_url(SELF_URL_PATH, $_REQUEST["url"]);
|
$url = rewrite_relative_url(SELF_URL_PATH, $_REQUEST["url"]);
|
||||||
$kind = (int) $_REQUEST["kind"]; // 1 = video
|
$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';
|
$extension = $kind == 1 ? '.mp4' : '.png';
|
||||||
$local_filename = CACHE_DIR . "/images/" . sha1($url) . $extension;
|
$local_filename = CACHE_DIR . "/images/" . sha1($url) . $extension;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue