-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(files): Allow to configure Windows filename compatibility in the settings #46558
Conversation
|
||
public function setFilesWindowsSupport(bool $enabled = true): void { | ||
if ($enabled) { | ||
$basenames = array_unique(array_values(array_merge(self::WINDOWS_BASENAMES, $this->filenameValidator->getForbiddenBasenames()))); |
Check failure
Code scanning / Psalm
RedundantFunctionCall Error
public function setFilesWindowsSupport(bool $enabled = true): void { | ||
if ($enabled) { | ||
$basenames = array_unique(array_values(array_merge(self::WINDOWS_BASENAMES, $this->filenameValidator->getForbiddenBasenames()))); | ||
$characters = array_unique(array_values(array_merge(self::WINDOWS_CHARACTERS, $this->filenameValidator->getForbiddenCharacters()))); |
Check failure
Code scanning / Psalm
RedundantFunctionCall Error
if ($enabled) { | ||
$basenames = array_unique(array_values(array_merge(self::WINDOWS_BASENAMES, $this->filenameValidator->getForbiddenBasenames()))); | ||
$characters = array_unique(array_values(array_merge(self::WINDOWS_CHARACTERS, $this->filenameValidator->getForbiddenCharacters()))); | ||
$extensions = array_unique(array_values(array_merge(self::WINDOWS_EXTENSION, $this->filenameValidator->getForbiddenExtensions()))); |
Check failure
Code scanning / Psalm
RedundantFunctionCall Error
9a34e3c
to
f0bba45
Compare
f0bba45
to
b201a7e
Compare
eeac0e1
to
74aac75
Compare
apps/files/lib/Listener/DeclarativeSettingsGetValueEventListener.php
Outdated
Show resolved
Hide resolved
… settings This adds an admin setting to toggle Windows filename compatibility. Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Co-authored-by: Louis <louis@chmn.me> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
f5ca3d6
to
0936af9
Compare
$event->setValue( | ||
match($event->getFieldId()) { | ||
'windows_support' => $this->service->hasFilesWindowsSupport(), | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability nitpick
$event->setValue( | |
match($event->getFieldId()) { | |
'windows_support' => $this->service->hasFilesWindowsSupport(), | |
} | |
); | |
if ($event->getFieldId() === 'windows_support') { | |
$event->setValue($this->service->hasFilesWindowsSupport()); | |
} |
Hi, |
@ThibautPlg currently not you would have to set every setting manually so manually configure invalid characters and extensions. But this is a planed feature |
Summary
This adds an admin setting to toggle Windows filename compatibility.
Checklist