Move SSLify code from Photo cache addon

This commit is contained in:
Max Kostikov 2018-12-17 09:13:03 +01:00
parent 72dc6ea77c
commit 05cb4fd897

View File

@ -159,15 +159,14 @@ class Photo extends \Zotlabs\Web\Controller {
// Validate cache
$cache = array(
'resid' => $photo,
'uid' => $r[0]['uid'],
'status' => false
'url' => htmlspecialchars_decode($r[0]['display_path'])
);
if($cache_mode['on'])
call_hooks('cache_url_hook', $cache);
if(! $cache['status']) {
$url = htmlspecialchars_decode($r[0]['display_path']);
call_hooks('cache_sslify_hook', $url);
header("Location: " . $url);
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']);
killme();
}
}