From cfa8df7415902e8a28e7b3a7cc3264392ef93294 Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Mon, 10 Feb 2025 19:08:17 -0700 Subject: [PATCH] Remove any trailing slashes from directory path during theme install Signed-off-by: Jon Stovell --- Sources/Actions/Admin/Themes.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Actions/Admin/Themes.php b/Sources/Actions/Admin/Themes.php index 861248fff4..8cafae0330 100644 --- a/Sources/Actions/Admin/Themes.php +++ b/Sources/Actions/Admin/Themes.php @@ -1585,6 +1585,8 @@ protected function installCopy(): array */ protected function installDir(): array { + $_REQUEST['theme_dir'] = rtrim($_REQUEST['theme_dir'], '\\/'); + // Cannot use the theme dir as a theme dir. if (!isset($_REQUEST['theme_dir']) || empty($_REQUEST['theme_dir']) || rtrim(realpath($_REQUEST['theme_dir']), '/\\') == realpath(Utils::$context['themedir'])) { ErrorHandler::fatalLang('theme_install_invalid_dir', false);