diff options
author | Andrew Dolgov <[email protected]> | 2019-08-14 10:10:27 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-14 10:10:27 +0300 |
commit | d2f1cbfcb1da1277b0be0e527956a4f932bce00a (patch) | |
tree | c8c778da111b78715d4c4eeae3d6cc66b38bc082 | |
parent | c6ae5fbda1b0945e585b2f75fac5b673dbf02728 (diff) |
af_zz_imgproxy: redirect to cached_url (3!!)
-rwxr-xr-x | plugins/af_zz_imgproxy/init.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php index 319fccee8..3c9744666 100755 --- a/plugins/af_zz_imgproxy/init.php +++ b/plugins/af_zz_imgproxy/init.php @@ -111,21 +111,22 @@ class Af_Zz_ImgProxy extends Plugin { } private function rewrite_url_if_needed($url, $all_remote = false) { - $scheme = parse_url($url, PHP_URL_SCHEME); + /* we don't need to handle URLs where local cache already exists, tt-rss rewrites those automatically */ + if (!$this->cache->exists(sha1($url))) { - if ($all_remote) { - $host = parse_url($url, PHP_URL_HOST); - $self_host = parse_url(get_self_url_prefix(), PHP_URL_HOST); + $scheme = parse_url($url, PHP_URL_SCHEME); - $is_remote = $host != $self_host; - } else { - $is_remote = false; - } + if ($all_remote) { + $host = parse_url($url, PHP_URL_HOST); + $self_host = parse_url(get_self_url_prefix(), PHP_URL_HOST); + + $is_remote = $host != $self_host; + } else { + $is_remote = false; + } - if (($scheme != 'https' && $scheme != "") || $is_remote) { - if (strpos($url, "data:") !== 0) { - /* we don't need to handle URLs where local cache already exists, tt-rss rewrites those automatically */ - if (!$this->cache->exists(sha1($url))) { + if (($scheme != 'https' && $scheme != "") || $is_remote) { + if (strpos($url, "data:") !== 0) { $parts = parse_url($url); foreach (explode(" " , $this->ssl_known_whitelist) as $host) { |