aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-04-15 20:53:44 -0700
committerzotlabs <mike@macgirvin.com>2019-04-15 20:53:44 -0700
commitdf5a1c59e6d2a0921de177aabacbee674d7385da (patch)
tree659c8b64743ac4cb894820eaa0f3ca47329b13d3 /include/attach.php
parent0615709a7ab7bba66b2a07d593e84a35ed083edb (diff)
parent71f17a233e29a45304f43ee2329bfff1865c6917 (diff)
downloadvolse-hubzilla-df5a1c59e6d2a0921de177aabacbee674d7385da.tar.gz
volse-hubzilla-df5a1c59e6d2a0921de177aabacbee674d7385da.tar.bz2
volse-hubzilla-df5a1c59e6d2a0921de177aabacbee674d7385da.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/attach.php b/include/attach.php
index f6594b154..f169e0669 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1521,6 +1521,17 @@ function attach_drop_photo($channel_id,$resource) {
if($x) {
drop_item($x[0]['id'],false,(($x[0]['item_hidden']) ? DROPITEM_NORMAL : DROPITEM_PHASE1),true);
}
+
+ $r = q("SELECT content FROM photo WHERE resource_id = '%s' AND uid = %d AND os_storage = 1",
+ dbesc($resource),
+ intval($channel_id)
+ );
+ if($r) {
+ foreach($r as $i) {
+ @unlink(dbunescbin($i['content']));
+ }
+ }
+
q("DELETE FROM photo WHERE uid = %d AND resource_id = '%s'",
intval($channel_id),
dbesc($resource)