diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-10 16:59:26 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-11 13:31:54 +0200 |
commit | a229723b8c65183f8cb7b62f24f7b9c41a2b622b (patch) | |
tree | df4a12b49dc500f877a58603f1c47d65d7bfe814 /lib/private/Template | |
parent | b09347ae536da3640d5cb8cff4254325f6e90926 (diff) | |
download | nextcloud-server-a229723b8c65183f8cb7b62f24f7b9c41a2b622b.tar.gz nextcloud-server-a229723b8c65183f8cb7b62f24f7b9c41a2b622b.zip |
feat: Add new forbidden filename options to Capabilities
Allow clients to access the new filename validation options
and make frontend name validation possible.
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private/Template')
-rw-r--r-- | lib/private/Template/JSConfigHelper.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php index a41e99ae8c4..963c158a793 100644 --- a/lib/private/Template/JSConfigHelper.php +++ b/lib/private/Template/JSConfigHelper.php @@ -10,6 +10,7 @@ namespace OC\Template; use bantu\IniGetWrapper\IniGetWrapper; use OC\Authentication\Token\IProvider; use OC\CapabilitiesManager; +use OC\Files\FilenameValidator; use OC\Share\Share; use OCP\App\AppPathNotFoundException; use OCP\App\IAppManager; @@ -51,6 +52,7 @@ class JSConfigHelper { protected CapabilitiesManager $capabilitiesManager, protected IInitialStateService $initialStateService, protected IProvider $tokenProvider, + protected FilenameValidator $filenameValidator, ) { } @@ -132,9 +134,12 @@ class JSConfigHelper { $capabilities = $this->capabilitiesManager->getCapabilities(false, true); $config = [ - 'auto_logout' => $this->config->getSystemValue('auto_logout', false), + /** @deprecated 30.0.0 - use files capabilities instead */ 'blacklist_files_regex' => FileInfo::BLACKLIST_FILES_REGEX, - 'forbidden_filename_characters' => Util::getForbiddenFileNameChars(), + /** @deprecated 30.0.0 - use files capabilities instead */ + 'forbidden_filename_characters' => $this->filenameValidator->getForbiddenCharacters(), + + 'auto_logout' => $this->config->getSystemValue('auto_logout', false), 'loglevel' => $this->config->getSystemValue('loglevel_frontend', $this->config->getSystemValue('loglevel', ILogger::WARN) ), |