summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-14 10:10:27 +0300
committerAndrew Dolgov <[email protected]>2019-08-14 10:10:27 +0300
commitd2f1cbfcb1da1277b0be0e527956a4f932bce00a (patch)
treec8c778da111b78715d4c4eeae3d6cc66b38bc082 /plugins
parentc6ae5fbda1b0945e585b2f75fac5b673dbf02728 (diff)
af_zz_imgproxy: redirect to cached_url (3!!)
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_zz_imgproxy/init.php25
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) {