aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-08 18:06:52 -0800
committerfriendica <info@friendica.com>2014-01-08 18:06:52 -0800
commit6eda8064449d154614345e9bd867dce2faba0deb (patch)
tree6f03b6ee33145908b983ae5d7da66eddc725ac84 /include/attach.php
parentc4be3450bf6112adf5de078e6c0243c89f8519b5 (diff)
downloadvolse-hubzilla-6eda8064449d154614345e9bd867dce2faba0deb.tar.gz
volse-hubzilla-6eda8064449d154614345e9bd867dce2faba0deb.tar.bz2
volse-hubzilla-6eda8064449d154614345e9bd867dce2faba0deb.zip
This should be approaching completion for file OS storage. May be a few minor bugs remaining due to some late-breaking fixes but I've been testing it as I go.
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/include/attach.php b/include/attach.php
index 93c9a5424..f2f889fd7 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -679,6 +679,12 @@ function attach_change_permissions($channel_id,$resource,$allow_cid,$allow_gid,$
function attach_delete($channel_id,$resource) {
+ $c = q("select channel_address from channel where channel_id = %d limit 1",
+ intval($channel_id)
+ );
+
+ $channel_address = (($c) ? $c[0]['channel_address'] : 'notfound');
+
$r = q("select hash, flags from attach where hash = '%s' and uid = %d limit 1",
dbesc($resource),
intval($channel_id)
@@ -705,10 +711,11 @@ function attach_delete($channel_id,$resource) {
);
if($y) {
- if(is_dir($y[0]['data']))
- @rmdir($y[0]['data']);
- elseif(file_exists($y[0]['data']))
- unlink($y[0]['data']);
+ $f = 'store/' . $channel_address . '/' . $y[0]['data'];
+ if(is_dir($f))
+ @rmdir($f);
+ elseif(file_exists($f))
+ unlink($f);
}
}