Merge branch 'dev' into 'dev'
Prevent return wrong profile photo modification date by plugin See merge request hubzilla/core!1582
This commit is contained in:
commit
9d5f8883a7
@ -71,29 +71,32 @@ class Photo extends \Zotlabs\Web\Controller {
|
|||||||
$modified = filemtime($default);
|
$modified = filemtime($default);
|
||||||
$default = z_root() . '/' . $default;
|
$default = z_root() . '/' . $default;
|
||||||
$uid = $person;
|
$uid = $person;
|
||||||
|
|
||||||
|
$data = '';
|
||||||
|
|
||||||
$d = [ 'imgscale' => $resolution, 'channel_id' => $uid, 'default' => $default, 'data' => '', 'mimetype' => '' ];
|
$r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1",
|
||||||
call_hooks('get_profile_photo',$d);
|
intval($resolution),
|
||||||
|
intval($uid),
|
||||||
$resolution = $d['imgscale'];
|
intval(PHOTO_PROFILE)
|
||||||
$uid = $d['channel_id'];
|
);
|
||||||
$default = $d['default'];
|
if($r) {
|
||||||
$data = $d['data'];
|
$modified = strtotime($r[0]['edited'] . "Z");
|
||||||
$mimetype = $d['mimetype'];
|
$mimetype = $r[0]['mimetype'];
|
||||||
|
if(intval($r[0]['os_storage']))
|
||||||
|
$data = file_get_contents($data);
|
||||||
|
else
|
||||||
|
$data = dbunescbin($r[0]['content']);
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
Reference in New Issue
Block a user