This commit is contained in:
estellbright
2018-04-28 10:18:46 +08:00
parent 538b7c65a3
commit 101832bcfd
2 changed files with 14 additions and 1 deletions
+3 -1
View File
@@ -306,7 +306,9 @@ class file extends control
$file = $this->file->getById($fileID);
$this->dao->delete()->from(TABLE_FILE)->where('id')->eq($fileID)->exec();
$this->loadModel('action')->create($file->objectType, $file->objectID, 'deletedFile', '', $extra=$file->title);
@unlink($file->realPath);
/* Fix Bug #1518. */
$fileRecord = $this->dao->select('id')->from(TABLE_FILE)->where('pathname')->eq($file->pathname)->fetch();
if(empty($fileRecord)) @unlink($file->realPath);
die(js::reload('parent'));
}
}