Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(exAppArchiveFetcher): correct apps_paths handling
Signed-off-by: Andrey Borysenko <[email protected]>
  • Loading branch information
andrey18106 authored and backportbot[bot] committed Sep 12, 2025
commit 3e687e01ae420c59d5391a9337f5bd8dfef51c95
24 changes: 18 additions & 6 deletions lib/Fetcher/ExAppArchiveFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function installTranslations(string $appId, string $dirTranslations): str
}

public function getExAppFolder(string $appId): ?string {
$appsPaths = $this->config->getSystemValue('apps_paths');
$appsPaths = $this->config->getSystemValue('apps_paths', []);
$existingPath = '';
foreach ($appsPaths as $appPath) {
if ($appPath['writable'] && file_exists($appPath['path'] . '/' . $appId)) {
Expand All @@ -112,15 +112,27 @@ public function getExAppFolder(string $appId): ?string {
}
}
}
// Fallback to default ExApp folder
$defaultExAppFolder = \OC::$SERVERROOT . '/apps/' . $appId;
if (is_dir($defaultExAppFolder)) {
return $defaultExAppFolder;
}
return null;
}

public function removeExAppFolder(string $appId): void {
foreach ($this->config->getSystemValue('apps_paths', []) as $appPath) {
if ($appPath['writable']) {
if (file_exists($appPath['path'] . '/' . $appId)) {
$this->rmdirr($appPath['path'] . '/' . $appId);
}
$appsPaths = $this->config->getSystemValue('apps_paths', []);
if (empty($appsPaths)) {
// fallback check of default ExApp folder
$defaultExAppFolder = \OC::$SERVERROOT . '/apps/' . $appId;
if (is_dir($defaultExAppFolder)) {
$this->rmdirr($defaultExAppFolder);
}
return;
}
foreach ($appsPaths as $appPath) {
if ($appPath['writable'] && file_exists($appPath['path'] . '/' . $appId)) {
$this->rmdirr($appPath['path'] . '/' . $appId);
}
}
}
Expand Down