aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller/ViewController.php
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2023-10-04 11:27:35 +0200
committerGitHub <noreply@github.com>2023-10-04 11:27:35 +0200
commit529bce24b44f7c10673e619fe062baeea5b5c3d5 (patch)
tree01d74039a52c6b347c20c3060b4e69443936a3b0 /apps/files/lib/Controller/ViewController.php
parentc88b02abff69ff25262b1760bc0beacca23c61ac (diff)
parentdbeb526bbab64e051958e1194e32903c2420e40d (diff)
downloadnextcloud-server-529bce24b44f7c10673e619fe062baeea5b5c3d5.tar.gz
nextcloud-server-529bce24b44f7c10673e619fe062baeea5b5c3d5.zip
Merge pull request #40585 from nextcloud/fix/illegal-characters
Diffstat (limited to 'apps/files/lib/Controller/ViewController.php')
-rw-r--r--apps/files/lib/Controller/ViewController.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index 8764e1fabd6..d4a75b514eb 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -52,6 +52,7 @@ use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\Collaboration\Resources\LoadAdditionalScriptsEvent as ResourcesLoadAdditionalScriptsEvent;
+use OCP\Constants;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
@@ -246,6 +247,11 @@ class ViewController extends Controller {
$filesSortingConfig = json_decode($this->config->getUserValue($userId, 'files', 'files_sorting_configs', '{}'), true);
$this->initialState->provideInitialState('filesSortingConfig', $filesSortingConfig);
+ // Forbidden file characters
+ /** @var string[] */
+ $forbiddenCharacters = $this->config->getSystemValue('forbidden_chars', []);
+ $this->initialState->provideInitialState('forbiddenCharacters', Constants::FILENAME_INVALID_CHARS . implode('', $forbiddenCharacters));
+
$event = new LoadAdditionalScriptsEvent();
$this->eventDispatcher->dispatchTyped($event);
$this->eventDispatcher->dispatchTyped(new ResourcesLoadAdditionalScriptsEvent());