From a26d8609a9d8bb9e905050f42cd20ab24a58e61d Mon Sep 17 00:00:00 2001 From: redmatrix Date: Thu, 5 Nov 2015 16:28:10 -0800 Subject: handle old files with partial paths --- include/attach.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'include/attach.php') 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); } -- cgit v1.2.3