fix regex

Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
Zoey 2024-03-20 08:42:56 +01:00 committed by GitHub
parent 172330b938
commit 976aca9139
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -742,7 +742,7 @@ class ConfigurationManager
// Trim all unwanted chars on both sites
$entry = trim($entry);
if ($entry !== "") {
if (!preg_match("#^/[.0-1a-zA-Z/_-]+$#", $entry) && !preg_match("#^[.0-1a-zA-Z_-]+$#", $entry)) {
if (!preg_match("#^/[.0-9a-zA-Z/_-]+$#", $entry) && !preg_match("#^[.0-9a-zA-Z_-]+$#", $entry)) {
throw new InvalidSettingConfigurationException("You entered unallowed characters! Problematic is " . $entry);
}
$validDirectories .= rtrim($entry, '/') . PHP_EOL;