summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-01 17:16:10 +0100
committerLukas Reschke <lukas@owncloud.com>2016-03-01 17:16:10 +0100
commit2d68c1b9450d77d21b08fc66436d286996583589 (patch)
treee2cadb47f8df155e040fecdf9f3a6b44f622898d
parent5fe5233f419624dc3eac8ee4bf95a38b001ea6fd (diff)
downloadnextcloud-server-2d68c1b9450d77d21b08fc66436d286996583589.tar.gz
nextcloud-server-2d68c1b9450d77d21b08fc66436d286996583589.zip
Exclude custom data directory from integrity checker
We should not scan any custom data directory in the integrity checker as well. Otherwise this would lead to a massive increased update time that may likely exceed the timeout. To test this: 1. Install ownCloud 8.2.2, set as data dir another folder than `data` such as `data-asdf`. Make sure that folder lives in the web root as well. 2. Update that instance to 9.0.0 beta2 => Errors are shown in the code integrity check 3. Apply this patch and trigger the rescan in the admin settings => No errors are shown anymore (can also do a new update with that patch applied) Fixes https://github.com/owncloud/core/issues/22698
-rw-r--r--lib/private/integritycheck/iterator/excludefoldersbypathfilteriterator.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/integritycheck/iterator/excludefoldersbypathfilteriterator.php b/lib/private/integritycheck/iterator/excludefoldersbypathfilteriterator.php
index 67bcd423b68..fc261e4bc5a 100644
--- a/lib/private/integritycheck/iterator/excludefoldersbypathfilteriterator.php
+++ b/lib/private/integritycheck/iterator/excludefoldersbypathfilteriterator.php
@@ -32,12 +32,18 @@ class ExcludeFoldersByPathFilterIterator extends \RecursiveFilterIterator {
$appFolders[$key] = rtrim($appFolder['path'], '/');
}
- $this->excludedFolders = array_merge([
+ $excludedFolders = [
rtrim($root . '/data', '/'),
rtrim($root .'/themes', '/'),
rtrim($root.'/config', '/'),
rtrim($root.'/apps', '/'),
- ], $appFolders);
+ ];
+ $customDataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', '');
+ if($customDataDir !== '') {
+ $excludedFolders[] = rtrim($customDataDir, '/');
+ }
+
+ $this->excludedFolders = array_merge($excludedFolders, $appFolders);
}
/**