aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-11-05 16:28:10 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-11-05 16:28:10 -0800
commita26d8609a9d8bb9e905050f42cd20ab24a58e61d (patch)
treeb68b43716d961cb97b46d35a1d238046b74bd937 /include/attach.php
parent001e4276d31149e07cef31e468dcc1e227e0eda9 (diff)
downloadvolse-hubzilla-a26d8609a9d8bb9e905050f42cd20ab24a58e61d.tar.gz
volse-hubzilla-a26d8609a9d8bb9e905050f42cd20ab24a58e61d.tar.bz2
volse-hubzilla-a26d8609a9d8bb9e905050f42cd20ab24a58e61d.zip
handle old files with partial paths
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/attach.php b/include/attach.php
index 8a568d8e1..36b971712 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -1270,9 +1270,13 @@ function attach_delete($channel_id, $resource, $is_photo = 0) {
);
if($y) {
- $f = 'store/' . $channel_address . '/' . $y[0]['data'];
- if(is_dir($y[0]['data']))
- @rmdir($y[0]['data']);
+ if(strpos($y[0]['data'],'store') === false)
+ $f = 'store/' . $channel_address . '/' . $y[0]['data'];
+ else
+ $f = $y[0]['data'];
+
+ if(is_dir($f))
+ @rmdir($f);
elseif(file_exists($f))
unlink($f);
}