Skip to content

Commit

Permalink
Remove any trailing slashes from directory path during theme install
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
  • Loading branch information
Sesquipedalian committed Feb 11, 2025
1 parent 3483d45 commit 3b9525b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3b9525b

Please sign in to comment.