diff --git a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php index 5d3f7104d6ad9..fc1276acd9601 100644 --- a/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php +++ b/apps/dav/lib/Connector/Sabre/BlockLegacyClientPlugin.php @@ -66,9 +66,11 @@ public function beforeHandler(RequestInterface $request) { } $minimumSupportedDesktopVersion = $this->config->getSystemValue('minimum.supported.desktop.version', '2.3.0'); + $maximumSupportedDesktopVersion = $this->config->getSystemValue('maximum.supported.desktop.version', '3.10.1'); preg_match(IRequest::USER_AGENT_CLIENT_DESKTOP, $userAgent, $versionMatches); if (isset($versionMatches[1]) && - version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1) { + version_compare($versionMatches[1], $minimumSupportedDesktopVersion) === -1 || + version_compare($versionMatches[1], $maximumSupportedDesktopVersion) === 1) { throw new \Sabre\DAV\Exception\Forbidden('Unsupported client version.'); } } diff --git a/config/config.sample.php b/config/config.sample.php index 9043dbd00aa35..5c86f8d12f9e0 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1999,6 +1999,17 @@ */ 'minimum.supported.desktop.version' => '2.3.0', +/** + * The maximum Nextcloud desktop client version that will be allowed to sync with + * this server instance. All connections made from later clients will be denied + * by the server. Defaults to the maximum officially supported Nextcloud desktop + * client version at the time of release of this server version. + * + * + * Defaults to ``3.10.1`` + */ +'maximum.supported.desktop.version' => '3.10.1', + /** * Option to allow local storage to contain symlinks. * WARNING: Not recommended. This would make it possible for Nextcloud to access