summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-10 14:41:11 +0300
committerAndrew Dolgov <[email protected]>2017-02-10 14:41:11 +0300
commit51198e7e40e4ac72c376baff27e9ec7bb4afab54 (patch)
tree48fb3cdb41df86cd82d2b5db06e0f8e374af884c /plugins
parent328118d12ef6ba98650da8e1a1a505e080a58adf (diff)
af_zz_imgproxy: urlencode() url parameter, DUH
Diffstat (limited to 'plugins')
-rw-r--r--plugins/af_zz_imgproxy/init.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php
index 0640a7b4c..67ca6c30f 100644
--- a/plugins/af_zz_imgproxy/init.php
+++ b/plugins/af_zz_imgproxy/init.php
@@ -33,7 +33,7 @@ class Af_Zz_ImgProxy extends Plugin {
$extension = $kind == 1 ? '.mp4' : '.png';
$local_filename = CACHE_DIR . "/images/" . sha1($url) . $extension;
- //if ($_REQUEST["debug"] == "1") { print $local_filename; die; }
+ if ($_REQUEST["debug"] == "1") { print $url . "\n" . $local_filename; die; }
header("Content-Disposition: inline; filename=\"".basename($local_filename)."\"");
@@ -47,6 +47,10 @@ class Af_Zz_ImgProxy extends Plugin {
readfile($local_filename);
} else {
$data = fetch_file_contents(array("url" => $url));
+
+ global $fetch_last_error;
+ print $fetch_last_error;
+
if ($data) {
if (file_put_contents($local_filename, $data)) {
$mimetype = mime_content_type($local_filename);
@@ -73,7 +77,7 @@ class Af_Zz_ImgProxy extends Plugin {
if (($scheme != 'https' && $scheme != "") || $is_remote) {
if (strpos($url, "data:") !== 0) {
$url = "backend.php?op=pluginhandler&plugin=af_zz_imgproxy&method=imgproxy&kind=$kind&url=" .
- htmlspecialchars($url);
+ urlencode($url);
}
}