Optimize cached photos processing

This commit is contained in:
Max Kostikov 2019-04-24 11:18:17 +02:00
parent 9104933b18
commit fe84dae313

View File

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