1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

File upload deletion complete & added extension handling

Also fixed issue with file editing on JS side
This commit is contained in:
Dan Brown
2016-10-23 13:36:45 +01:00
parent 867fc8be64
commit 7ee695d74a
6 changed files with 26 additions and 7 deletions

View File

@ -5,6 +5,7 @@ use BookStack\Book;
use BookStack\Chapter;
use BookStack\Entity;
use BookStack\Exceptions\NotFoundException;
use BookStack\Services\FileService;
use Carbon\Carbon;
use DOMDocument;
use DOMXPath;
@ -633,6 +634,13 @@ class PageRepo extends EntityRepo
$page->revisions()->delete();
$page->permissions()->delete();
$this->permissionService->deleteJointPermissionsForEntity($page);
// Delete AttachedFiles
$fileService = app(FileService::class);
foreach ($page->files as $file) {
$fileService->deleteFile($file);
}
$page->delete();
}