diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-04-24 00:02:09 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-04-29 17:01:32 +0200 |
commit | 6a281f019c73dec54f487890d7ff80d26a3f04bf (patch) | |
tree | 162bc41aca02f177126fe241715f4808cf346555 /apps/files | |
parent | 147426c3ca7183ad065293bd9b600e10adde4abf (diff) | |
download | nextcloud-server-6a281f019c73dec54f487890d7ff80d26a3f04bf.tar.gz nextcloud-server-6a281f019c73dec54f487890d7ff80d26a3f04bf.zip |
fix(files): Use OCP\Util::getForbiddenFileNameChars instead of direct access to system config
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 6 | ||||
-rw-r--r-- | apps/files/tests/Controller/ViewControllerTest.php | 5 |
2 files changed, 2 insertions, 9 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 67cd0bf2aef..2e6ffa6a749 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -52,7 +52,6 @@ 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; @@ -253,9 +252,8 @@ class ViewController extends Controller { $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)); + $forbiddenCharacters = \OCP\Util::getForbiddenFileNameChars(); + $this->initialState->provideInitialState('forbiddenCharacters', implode('', $forbiddenCharacters)); $event = new LoadAdditionalScriptsEvent(); $this->eventDispatcher->dispatchTyped($event); diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index 2714a6b25c0..79834539883 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -153,11 +153,6 @@ class ViewControllerTest extends TestCase { ]); $this->config - ->expects($this->any()) - ->method('getSystemValue') - ->with('forbidden_chars', []) - ->willReturn([]); - $this->config ->method('getUserValue') ->willReturnMap([ [$this->user->getUID(), 'files', 'file_sorting', 'name', 'name'], |