Skip to content

Commit

Permalink
Update 403 error message.
Browse files Browse the repository at this point in the history
The user should get a more friendly warning when their desktop client version is not supported anymore by the server.
See #nextcloud/desktop/issues/6273

Signed-off-by: Camila <[email protected]>
  • Loading branch information
camilasan authored and susnux committed Sep 6, 2024
1 parent a05e542 commit 39935f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public function beforeHandler(RequestInterface $request) {
preg_match(IRequest::USER_AGENT_CLIENT_DESKTOP, $userAgent, $versionMatches);
if (isset($versionMatches[1]) &&
version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1) {
throw new \Sabre\DAV\Exception\Forbidden('Unsupported client version.');
$customClientDesktopLink = $this->config->getSystemValue('customclient_desktop', 'https://nextcloud.com/install/#install-clients');
throw new \Sabre\DAV\Exception\Forbidden('This version of the client is unsupported. Upgrade to version '.$minimumSupportedDesktopVersion.' or later. Please open '.$customClientDesktopLink.' to download the update.');
}
}
}

0 comments on commit 39935f5

Please sign in to comment.