mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
improve setting the backup host location and allow /var/backups
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
fe99c3bc78
commit
178aeb80d2
2 changed files with 7 additions and 3 deletions
|
|
@ -172,14 +172,18 @@ class ConfigurationManager
|
|||
|
||||
$isValidPath = false;
|
||||
foreach($allowedPrefixes as $allowedPrefix) {
|
||||
if(str_starts_with($location, $allowedPrefix)) {
|
||||
if(str_starts_with($location, $allowedPrefix) && !str_ends_with($location, '/')) {
|
||||
$isValidPath = true;
|
||||
break;
|
||||
}
|
||||
if ($location === '/var/backups') {
|
||||
$isValidPath = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$isValidPath) {
|
||||
throw new InvalidSettingConfigurationException("Path must start with /mnt/ or /media/.");
|
||||
throw new InvalidSettingConfigurationException("The path must start with '/mnt/' or '/media/' or be equal to '/var/backups'.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue