hubzilla issue #868

This commit is contained in:
zotlabs
2017-10-03 17:03:24 -07:00
parent d88d4b3c3a
commit 7fb02752de
2 changed files with 25 additions and 0 deletions

View File

@@ -518,6 +518,27 @@ function guess_image_type($filename, $headers = '') {
}
function delete_thing_photo($url,$ob_hash) {
$hash = basename($url);
$hash = substr($hash,0,strpos($hash,'-'));
// hashes should be 32 bytes.
if(strlen($hash) < 16)
return;
$r = q("delete from photo where xchan = '%s' and photo_usage = %d and resource_id = '%s'",
dbesc($ob_hash),
intval(PHOTO_THING),
dbesc($hash)
);
}
function import_xchan_photo($photo,$xchan,$thing = false) {
$flags = (($thing) ? PHOTO_THING : PHOTO_XCHAN);