fix regex for additional backup dirs

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-10-17 11:22:07 +02:00
parent 92aae9dfd0
commit cea006c58f

View file

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