Skip to content

Commit

Permalink
Merge pull request #8460 from Sesquipedalian/2.1/theme_install_traili…
Browse files Browse the repository at this point in the history
…ng_slash

Remove any trailing slashes from directory path during theme install
  • Loading branch information
Sesquipedalian authored Feb 11, 2025
2 parents 3483d45 + 3b9525b commit 4a23d61
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 4a23d61

Please sign in to comment.