summaryrefslogtreecommitdiff
path: root/plugins/af_proxy_http
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-22 09:04:33 +0300
committerAndrew Dolgov <[email protected]>2020-09-22 09:04:33 +0300
commit74568df4ff7b7788991636f6fb2ed62012f85c3b (patch)
tree673bcb01157b38e4b38f8f4c8227012e8a750e18 /plugins/af_proxy_http
parentd04ac399ff284e9747e3fb55e87d05e0a5b8d85f (diff)
remove a lot of stuff from global context (functions.php), add a few helper classes instead
Diffstat (limited to 'plugins/af_proxy_http')
-rw-r--r--plugins/af_proxy_http/init.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/af_proxy_http/init.php b/plugins/af_proxy_http/init.php
index 7cb9355f3..2d9ae59b5 100644
--- a/plugins/af_proxy_http/init.php
+++ b/plugins/af_proxy_http/init.php
@@ -48,7 +48,7 @@ class Af_Proxy_Http extends Plugin {
}
public function imgproxy() {
- $url = validate_url(clean($_REQUEST["url"]));
+ $url = UrlHelper::validate(clean($_REQUEST["url"]));
// called without user context, let's just redirect to original URL
if (!$_SESSION["uid"] || $_REQUEST['af_proxy_http_token'] != $_SESSION['af_proxy_http_token']) {
@@ -62,7 +62,7 @@ class Af_Proxy_Http extends Plugin {
header("Location: " . $this->cache->getUrl($local_filename));
return;
} else {
- $data = fetch_file_contents(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]);
+ $data = UrlHelper::fetch(["url" => $url, "max_size" => MAX_CACHE_FILE_SIZE]);
if ($data) {
if ($this->cache->put($local_filename, $data)) {
@@ -125,7 +125,7 @@ class Af_Proxy_Http extends Plugin {
foreach (explode(" " , $this->ssl_known_whitelist) as $host) {
if (substr(strtolower($parts['host']), -strlen($host)) === strtolower($host)) {
$parts['scheme'] = 'https';
- $url = build_url($parts);
+ $url = UrlHelper::build_url($parts);
if ($all_remote && $is_remote) {
break;
} else {