DirectoryMatch the start of the folder, not every folder in any subdirectory

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-09-08 13:13:23 +02:00
parent 9decb077d3
commit 5f2f3bee0a

View File

@@ -173,7 +173,7 @@ class Apache extends HttpConfigBase
$this->virtualhosts_data[$vhosts_filename] .= ' </Files>' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";
// protect bin/
$this->virtualhosts_data[$vhosts_filename] .= ' <DirectoryMatch ~ "' . rtrim($relpath, "/") . '/(bin|cache|logs|tests|vendor)/">' . "\n";
$this->virtualhosts_data[$vhosts_filename] .= ' <DirectoryMatch "^' . rtrim($relpath, "/") . '/(bin|cache|logs|tests|vendor)/">' . "\n";
if (Settings::Get('system.apache24') == '1') {
$this->virtualhosts_data[$vhosts_filename] .= ' Require all denied' . "\n";
} else {