aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photo.php
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2012-05-20 09:08:56 +0200
committerzottel <github@zottel.net>2012-05-20 09:08:56 +0200
commit2cd3ec7b983327f8c162845d0f4b8d9753f30e27 (patch)
tree3eefeaf641e91416fa7b43b9a36b829f28ff1983 /mod/photo.php
parent764ac240a9a9ffb7c855a69bc2f81e9d314a617f (diff)
parentf16a1199408d167bbc7c52dc408ef02b36808317 (diff)
downloadvolse-hubzilla-2cd3ec7b983327f8c162845d0f4b8d9753f30e27.tar.gz
volse-hubzilla-2cd3ec7b983327f8c162845d0f4b8d9753f30e27.tar.bz2
volse-hubzilla-2cd3ec7b983327f8c162845d0f4b8d9753f30e27.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'mod/photo.php')
-rw-r--r--mod/photo.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/mod/photo.php b/mod/photo.php
index 1d38fe8e4..3cd8250a9 100644
--- a/mod/photo.php
+++ b/mod/photo.php
@@ -28,6 +28,8 @@ function photo_init(&$a) {
}
}*/
+ $prvcachecontrol = false;
+
switch($a->argc) {
case 4:
$person = $a->argv[3];
@@ -134,6 +136,7 @@ function photo_init(&$a) {
);
if(count($r)) {
$data = file_get_contents('images/nosign.jpg');
+ $prvcachecontrol = true;
}
}
}
@@ -179,8 +182,22 @@ function photo_init(&$a) {
}
header("Content-type: image/jpeg");
- header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT");
- header("Cache-Control: max-age=" . (3600*24));
+
+ if($prvcachecontrol) {
+
+ // it is a private photo that they have no permission to view.
+ // tell the browser not to cache it, in case they authenticate
+ // and subsequently have permission to see it
+
+ header("Cache-Control: no-store, no-cache, must-revalidate");
+
+ }
+ else {
+
+ header("Expires: " . gmdate("D, d M Y H:i:s", time() + (3600*24)) . " GMT");
+ header("Cache-Control: max-age=" . (3600*24));
+
+ }
echo $data;
killme();
// NOTREACHED