Prevent return wrong profile photo modification date by plugin

This commit is contained in:
Max Kostikov 2019-04-05 14:10:48 +02:00
parent 0c2db1cea5
commit e20c5cf9cf

View File

@ -72,28 +72,30 @@ class Photo extends \Zotlabs\Web\Controller {
$default = z_root() . '/' . $default; $default = z_root() . '/' . $default;
$uid = $person; $uid = $person;
$d = [ 'imgscale' => $resolution, 'channel_id' => $uid, 'default' => $default, 'data' => '', 'mimetype' => '' ]; $data = '';
call_hooks('get_profile_photo',$d);
$resolution = $d['imgscale']; $r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1",
$uid = $d['channel_id']; intval($resolution),
$default = $d['default']; intval($uid),
$data = $d['data']; intval(PHOTO_PROFILE)
$mimetype = $d['mimetype']; );
if($r) {
$modified = strtotime($r[0]['edited'] . "Z");
$data = dbunescbin($r[0]['content']);
$mimetype = $r[0]['mimetype'];
}
if(intval($r[0]['os_storage']))
$data = file_get_contents($data);
if(! $data) { if(! $data) {
$r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1", $d = [ 'imgscale' => $resolution, 'channel_id' => $uid, 'default' => $default, 'data' => '', 'mimetype' => '' ];
intval($resolution), call_hooks('get_profile_photo',$d);
intval($uid),
intval(PHOTO_PROFILE) $resolution = $d['imgscale'];
); $uid = $d['channel_id'];
if($r) { $default = $d['default'];
$modified = strtotime($r[0]['edited'] . "Z"); $data = $d['data'];
$data = dbunescbin($r[0]['content']); $mimetype = $d['mimetype'];
$mimetype = $r[0]['mimetype'];
}
if(intval($r[0]['os_storage']))
$data = file_get_contents($data);
} }
if(! $data) { if(! $data) {