summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-14 10:01:05 +0300
committerAndrew Dolgov <[email protected]>2019-08-14 10:01:05 +0300
commitc6ae5fbda1b0945e585b2f75fac5b673dbf02728 (patch)
tree11aab80b535e2dc3d617ae2cf43ded9dfed3ba40 /plugins
parente7edaca4dbae01521d2aada95af229ea3104845a (diff)
af_zz_imgproxy: redirect to cached_url if cache already exists so that urls are a bit shorter (2)
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_zz_imgproxy/init.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/plugins/af_zz_imgproxy/init.php b/plugins/af_zz_imgproxy/init.php
index 754de12e1..319fccee8 100755
--- a/plugins/af_zz_imgproxy/init.php
+++ b/plugins/af_zz_imgproxy/init.php
@@ -124,22 +124,22 @@ class Af_Zz_ImgProxy extends Plugin {
if (($scheme != 'https' && $scheme != "") || $is_remote) {
if (strpos($url, "data:") !== 0) {
- $parts = parse_url($url);
-
- foreach (explode(" " , $this->ssl_known_whitelist) as $host) {
- if (substr(strtolower($parts['host']), -strlen($host)) === strtolower($host)) {
- $parts['scheme'] = 'https';
- $url = build_url($parts);
- if ($all_remote && $is_remote) {
- break;
- } else {
- return $url;
+ /* we don't need to handle URLs where local cache already exists, tt-rss rewrites those automatically */
+ if (!$this->cache->exists(sha1($url))) {
+ $parts = parse_url($url);
+
+ foreach (explode(" " , $this->ssl_known_whitelist) as $host) {
+ if (substr(strtolower($parts['host']), -strlen($host)) === strtolower($host)) {
+ $parts['scheme'] = 'https';
+ $url = build_url($parts);
+ if ($all_remote && $is_remote) {
+ break;
+ } else {
+ return $url;
+ }
}
}
- }
- /* we don't need to handle URLs where local cache already exists, tt-rss rewrites those automatically */
- if (!$this->cache->exists(sha1($url))) {
return get_self_url_prefix() . "/public.php?op=pluginhandler&plugin=af_zz_imgproxy&pmethod=imgproxy&url=" .
urlencode($url);
}