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:
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user