diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-11-08 10:16:17 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-11-08 10:16:17 +0100 |
commit | 7c4c60425b176e80252bd9491ac0642532653e86 (patch) | |
tree | d4d7fa138a99efc582ff58cd6aec04cf4d28772d /Zotlabs | |
parent | 302f49baf2acc23e6ea5da9778eeb18ad97c444c (diff) | |
parent | 1b232041c93c3429d536ba5721b9f3c30f3d092f (diff) | |
download | volse-hubzilla-7c4c60425b176e80252bd9491ac0642532653e86.tar.gz volse-hubzilla-7c4c60425b176e80252bd9491ac0642532653e86.tar.bz2 volse-hubzilla-7c4c60425b176e80252bd9491ac0642532653e86.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Photo.php | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index d76fca278..d3d82f035 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -10,7 +10,7 @@ require_once('include/photos.php'); class Photo extends \Zotlabs\Web\Controller { function init() { - + $prvcachecontrol = false; $streaming = null; $channel = null; @@ -32,6 +32,7 @@ class Photo extends \Zotlabs\Web\Controller { } $observer_xchan = get_observer_hash(); + $ismodified = $_SERVER['HTTP_IF_MODIFIED_SINCE']; if(isset($type)) { @@ -86,6 +87,7 @@ class Photo extends \Zotlabs\Web\Controller { if(intval($r[0]['os_storage'])) $data = file_get_contents($data); } + if(! $data) { $data = fetch_image_from_url($default,$mimetype); } @@ -179,8 +181,19 @@ class Photo extends \Zotlabs\Web\Controller { } } + } else { + http_status_exit(404,'not found'); } } + + header_remove('Pragma'); + + if($ismodified === gmdate("D, d M Y H:i:s", $modified) . " GMT") { + header_remove('Expires'); + header_remove('Cache-Control'); + header_remove('Set-Cookie'); + http_status_exit(304,'not modified'); + } if(! isset($data)) { if(isset($resolution)) { @@ -219,11 +232,6 @@ class Photo extends \Zotlabs\Web\Controller { } - if(function_exists('header_remove')) { - header_remove('Pragma'); - header_remove('pragma'); - } - header("Content-type: " . $mimetype); if($prvcachecontrol) { |