From 957663b48bc29fc7d4d070823b4db8d65571bb2e Mon Sep 17 00:00:00 2001 From: Duncan Cameron <3147688+bramley@users.noreply.github.com> Date: Sun, 24 Mar 2024 20:32:43 +0000 Subject: [PATCH] Use the page UUID to identify the upload directory when deleting a page Fixes #1545 --- bl-kernel/pages.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bl-kernel/pages.class.php b/bl-kernel/pages.class.php index e3bc3b0b..0da47ab0 100644 --- a/bl-kernel/pages.class.php +++ b/bl-kernel/pages.class.php @@ -322,8 +322,10 @@ class Pages extends dbJSON { } // Delete page images directory; The function already check if exists the directory - if (Filesystem::deleteRecursive(PATH_UPLOADS_PAGES.$key) === false) { - Log::set(__METHOD__.LOG_SEP.'Directory with images not found '.PATH_UPLOADS_PAGES.$key); + if (($uuid = $this->getUUID($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