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 4732af1 commit cfa8df7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Actions/Admin/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cfa8df7

Please sign in to comment.