handle old files with partial paths

This commit is contained in:
redmatrix
2015-11-05 16:28:10 -08:00
parent 001e4276d3
commit a26d8609a9
3 changed files with 18 additions and 6 deletions

View File

@@ -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);
}