aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2018-12-24 09:22:58 +0100
committerMax Kostikov <max@kostikov.co>2018-12-24 09:22:58 +0100
commit37d7d18bb7b1e3bcadbb11c43a761d6953c2dc55 (patch)
tree504a4a9b6f8df99fead90bf7c571ae1e944d9d6a
parentcdb85f130933b2abe9da80119696f5d1d55bebc4 (diff)
downloadvolse-hubzilla-37d7d18bb7b1e3bcadbb11c43a761d6953c2dc55.tar.gz
volse-hubzilla-37d7d18bb7b1e3bcadbb11c43a761d6953c2dc55.tar.bz2
volse-hubzilla-37d7d18bb7b1e3bcadbb11c43a761d6953c2dc55.zip
Faster image processing with photo cache addon
-rw-r--r--Zotlabs/Module/Photo.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php
index e236cc5f4..96a4e1f40 100644
--- a/Zotlabs/Module/Photo.php
+++ b/Zotlabs/Module/Photo.php
@@ -159,14 +159,15 @@ class Photo extends \Zotlabs\Web\Controller {
// Validate cache
$cache = array(
'resid' => $photo,
- 'url' => htmlspecialchars_decode($r[0]['display_path'])
+ 'status' => false
);
if($cache_mode['on'])
call_hooks('cache_url_hook', $cache);
- if($cache['url'] != '') {
- if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false)
- $cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']);
- header("Location: " . $cache['url']);
+ if(! $cache['status']) {
+ $url = htmlspecialchars_decode($r[0]['display_path']);
+ if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false)
+ $url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url);
+ header("Location: " . $url);
killme();
}
}