Use the page UUID to identify the upload directory when deleting a page

Fixes #1545
This commit is contained in:
Duncan Cameron 2024-03-24 20:32:43 +00:00
parent d586fce4f2
commit 957663b48b

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