Merge pull request #1564 from bramley/remove_upload_when_deleting_content_page

Use the page UUID to identify the upload directory when deleting a page
This commit is contained in:
Diego Najar 2024-03-29 10:07:57 +01:00 committed by GitHub
commit af7488f1b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -322,8 +322,10 @@ class Pages extends dbJSON {
} }
// Delete page images directory; The function already check if exists the directory // Delete page images directory; The function already check if exists the directory
if (Filesystem::deleteRecursive(PATH_UPLOADS_PAGES.$key) === false) { if (($uuid = $this->getUUID($key))) {
Log::set(__METHOD__.LOG_SEP.'Directory with images not found '.PATH_UPLOADS_PAGES.$key); if (Filesystem::deleteRecursive(PATH_UPLOADS_PAGES.$uuid) === false) {
Log::set(__METHOD__.LOG_SEP.'Directory with images not found '.PATH_UPLOADS_PAGES.$uuid);
}
} }
// Remove from database // Remove from database