From 3b9525bff09f15bf82375c76dbf6df90402e71da Mon Sep 17 00:00:00 2001 From: Jon Stovell Date: Mon, 10 Feb 2025 18:51:09 -0700 Subject: [PATCH] Remove any trailing slashes from directory path during theme install Signed-off-by: Jon Stovell --- Sources/Themes.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Themes.php b/Sources/Themes.php index 3b0a2ffcce..46aa453a67 100644 --- a/Sources/Themes.php +++ b/Sources/Themes.php @@ -1425,6 +1425,8 @@ function InstallDir() { global $themedir, $themeurl, $context; + $_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($themedir)) fatal_lang_error('theme_install_invalid_dir', false);