Merge pull request #4411 from nextcloud/fix-regex

Additonal backup paths - fix regex
This commit is contained in:
Simon L 2024-03-21 09:12:25 +01:00 committed by GitHub
commit 2b169779a9
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;