mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(files): Use OCP\Util::getForbiddenFileNameChars instead of direct access to system config
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
147426c3ca
commit
6a281f019c
2 changed files with 2 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -152,11 +152,6 @@ class ViewControllerTest extends TestCase {
|
|||
'ownerDisplayName' => 'MyDisplayName',
|
||||
]);
|
||||
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->with('forbidden_chars', [])
|
||||
->willReturn([]);
|
||||
$this->config
|
||||
->method('getUserValue')
|
||||
->willReturnMap([
|
||||
|
|
|
|||
Loading…
Reference in a new issue