Faster image processing with photo cache addon

This commit is contained in:
Max Kostikov 2018-12-24 09:22:58 +01:00
parent cdb85f1309
commit 37d7d18bb7

View File

@ -159,14 +159,15 @@ class Photo extends \Zotlabs\Web\Controller {
// Validate cache // Validate cache
$cache = array( $cache = array(
'resid' => $photo, 'resid' => $photo,
'url' => htmlspecialchars_decode($r[0]['display_path']) 'status' => false
); );
if($cache_mode['on']) if($cache_mode['on'])
call_hooks('cache_url_hook', $cache); call_hooks('cache_url_hook', $cache);
if($cache['url'] != '') { if(! $cache['status']) {
if(strpos(z_root(),'https:') !== false && strpos($cache['url'],'https:') === false) $url = htmlspecialchars_decode($r[0]['display_path']);
$cache['url'] = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($cache['url']); if(strpos(z_root(),'https:') !== false && strpos($url,'https:') === false)
header("Location: " . $cache['url']); $url = z_root() . '/sslify/' . $filename . '?f=&url=' . urlencode($url);
header("Location: " . $url);
killme(); killme();
} }
} }