mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix: Make federation TrustedServers dependency optional in RemotePlugin
The federation app is not always installed, causing QueryException when `OCA\Federation\TrustedServers` is injected as a hard dependency. Signed-off-by: nfebe <fenn25.fn@gmail.com>
This commit is contained in:
parent
da82f6f79f
commit
d384071352
1 changed files with 4 additions and 4 deletions
|
|
@ -30,7 +30,7 @@ class RemotePlugin implements ISearchPlugin {
|
|||
private IUserManager $userManager,
|
||||
IUserSession $userSession,
|
||||
private IAppConfig $appConfig,
|
||||
private TrustedServers $trustedServers,
|
||||
private ?TrustedServers $trustedServers,
|
||||
) {
|
||||
$this->userId = $userSession->getUser()?->getUID() ?? '';
|
||||
$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
|
||||
|
|
@ -107,7 +107,7 @@ class RemotePlugin implements ISearchPlugin {
|
|||
'shareType' => IShare::TYPE_REMOTE,
|
||||
'shareWith' => $cloudId,
|
||||
'server' => $serverUrl,
|
||||
'isTrustedServer' => $this->trustedServers->isTrustedServer($serverUrl),
|
||||
'isTrustedServer' => $this->trustedServers?->isTrustedServer($serverUrl) ?? false,
|
||||
],
|
||||
];
|
||||
} else {
|
||||
|
|
@ -120,7 +120,7 @@ class RemotePlugin implements ISearchPlugin {
|
|||
'shareType' => IShare::TYPE_REMOTE,
|
||||
'shareWith' => $cloudId,
|
||||
'server' => $serverUrl,
|
||||
'isTrustedServer' => $this->trustedServers->isTrustedServer($serverUrl),
|
||||
'isTrustedServer' => $this->trustedServers?->isTrustedServer($serverUrl) ?? false,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -147,7 +147,7 @@ class RemotePlugin implements ISearchPlugin {
|
|||
'shareType' => IShare::TYPE_REMOTE,
|
||||
'shareWith' => $search,
|
||||
'server' => $serverUrl,
|
||||
'isTrustedServer' => $this->trustedServers->isTrustedServer($serverUrl),
|
||||
'isTrustedServer' => $this->trustedServers?->isTrustedServer($serverUrl) ?? false,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue