aboutsummaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-07-15 16:29:44 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-16 12:49:10 +0200
commitf4ede27cdbbb4f55bb963130295a28a89a833d94 (patch)
treefefcca04d1fff7e897e13da0ac3fcc4bef70a3d4 /apps/federatedfilesharing
parent69341e4306259430533cf66fd0a76688c7c8e6ab (diff)
downloadnextcloud-server-f4ede27cdbbb4f55bb963130295a28a89a833d94.tar.gz
nextcloud-server-f4ede27cdbbb4f55bb963130295a28a89a833d94.zip
refactor: Remove deprecated `Util` function for filename validation to `FilenameValidator`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
index 2f41502d4f6..e1bbbbc310f 100644
--- a/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
+++ b/apps/federatedfilesharing/lib/OCM/CloudFederationProviderFiles.php
@@ -23,6 +23,7 @@ use OCP\Federation\ICloudFederationProvider;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Federation\ICloudFederationShare;
use OCP\Federation\ICloudIdManager;
+use OCP\Files\IFilenameValidator;
use OCP\Files\NotFoundException;
use OCP\HintException;
use OCP\IConfig;
@@ -59,6 +60,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
private IConfig $config,
private Manager $externalShareManager,
private LoggerInterface $logger,
+ private IFilenameValidator $filenameValidator,
) {
}
@@ -115,7 +117,7 @@ class CloudFederationProviderFiles implements ICloudFederationProvider {
}
if ($remote && $token && $name && $owner && $remoteId && $shareWith) {
- if (!Util::isValidFileName($name)) {
+ if (!$this->filenameValidator->isFilenameValid($name)) {
throw new ProviderCouldNotAddShareException('The mountpoint name contains invalid characters.', '', Http::STATUS_BAD_REQUEST);
}