浏览代码

show permission denied photo when direct link was accessed and authentication is insufficient to view

tags/2.2
Friendika 9 年前
父节点
当前提交
2270e73fcd
共有 2 个文件被更改,包括 18 次插入0 次删除
  1. 二进制
      images/nosign.jpg
  2. +18
    -0
      mod/photo.php

二进制
images/nosign.jpg 查看文件

之前 之后
宽度: 150  |  高度: 150  |  大小: 6.3 KiB

+ 18
- 0
mod/photo.php 查看文件

@@ -108,6 +108,24 @@ function photo_init(&$a) {
if(count($r)) {
$data = $r[0]['data'];
}
else {

// Does the picture exist? It may be a remote person with no credentials,
// but who should otherwise be able to view it. Show a default image to let
// them know permissions was denied. It may be possible to view the image
// through an authenticated profile visit.
// There won't be many complete unauthorised people seeing this because
// they won't have the photo link, so there's a reasonable chance that the person
// might be able to obtain permission to view it.
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s' AND `scale` = %d LIMIT 1",
dbesc($photo),
intval($resolution)
);
if(count($r)) {
$data = file_get_contents('images/nosign.jpg');
}
}
}
}



正在加载...
取消
保存