Skip to content

Commit 2da2659

Browse files
committed
filters some folder from nextcloud/core
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 740baf0 commit 2da2659

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/Model/RestoringData.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ class RestoringData implements IDeserializable, JsonSerializable {
7474
];
7575

7676

77+
// filtering folders from the 'core' data
78+
public static $FILTER_FROM_NC = [
79+
'apps/',
80+
'data/',
81+
'config/'
82+
];
83+
84+
7785
/** @var string */
7886
private $name;
7987

lib/Service/FilesService.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ public function fillRestoringData(RestoringData $data, string $path): void {
114114
return;
115115
}
116116

117+
if ($data->getType() === RestoringData::ROOT_NEXTCLOUD) {
118+
foreach (RestoringData::$FILTER_FROM_NC as $item) {
119+
if ($path === $item) {
120+
return;
121+
}
122+
}
123+
}
124+
117125
foreach (scandir($data->getAbsolutePath() . $path) as $entry) {
118126
if ($entry === '.' || $entry === '..') {
119127
continue;

0 commit comments

Comments
 (0)