diff --git a/apps/files/lib/Capabilities.php b/apps/files/lib/Capabilities.php index dc2aae6acfcd9..54b57aed0745d 100644 --- a/apps/files/lib/Capabilities.php +++ b/apps/files/lib/Capabilities.php @@ -39,13 +39,14 @@ public function __construct(IConfig $config) { /** * Return this classes capabilities * - * @return array{files: array{bigfilechunking: bool, blacklisted_files: array}} + * @return array{files: array{bigfilechunking: bool, blacklisted_files: array, forbidden_filename_characters: array}} */ public function getCapabilities() { return [ 'files' => [ 'bigfilechunking' => true, - 'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']) + 'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']), + 'forbidden_filename_characters' => \OC_Util::getForbiddenFileNameChars(), ], ]; } diff --git a/apps/files/openapi.json b/apps/files/openapi.json index f9432f6c57cd1..f9cdb67783d78 100644 --- a/apps/files/openapi.json +++ b/apps/files/openapi.json @@ -31,6 +31,7 @@ "required": [ "bigfilechunking", "blacklisted_files", + "forbidden_filename_characters", "directEditing" ], "properties": { @@ -43,6 +44,12 @@ "type": "object" } }, + "forbidden_filename_characters": { + "type": "array", + "items": { + "type": "string" + } + }, "directEditing": { "type": "object", "required": [ diff --git a/config/config.sample.php b/config/config.sample.php index d999b1e39b0b0..79f813a4daec2 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -1962,6 +1962,8 @@ /** * Blacklist characters from being used in filenames. This is useful if you * have a filesystem or OS which does not support certain characters like windows. + * + * The '/' and '\' characters are always forbidden. * * Example for windows systems: ``array('?', '<', '>', ':', '*', '|', '"', chr(0), "\n", "\r")`` * see https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits