|
7 | 7 | */ |
8 | 8 | namespace OCA\Files; |
9 | 9 |
|
| 10 | +use OC\Files\FilenameValidator; |
10 | 11 | use OCP\Capabilities\ICapability; |
11 | | -use OCP\IConfig; |
12 | 12 |
|
13 | 13 | class Capabilities implements ICapability { |
14 | 14 |
|
15 | | - protected IConfig $config; |
16 | | - |
17 | | - public function __construct(IConfig $config) { |
18 | | - $this->config = $config; |
| 15 | + public function __construct( |
| 16 | + protected FilenameValidator $filenameValidator, |
| 17 | + ) { |
19 | 18 | } |
20 | 19 |
|
21 | 20 | /** |
22 | 21 | * Return this classes capabilities |
23 | 22 | * |
24 | | - * @return array{files: array{bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filename_characters: array<string>}} |
| 23 | + * @return array{files: array{$comment: string, bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>}} |
25 | 24 | */ |
26 | 25 | public function getCapabilities() { |
27 | 26 | return [ |
28 | 27 | 'files' => [ |
| 28 | + '$comment' => '"blacklisted_files" is deprecacted as of Nextcloud 30, use "forbidden_filenames" instead', |
| 29 | + 'blacklisted_files' => $this->filenameValidator->getForbiddenFilenames(), |
| 30 | + 'forbidden_filenames' => $this->filenameValidator->getForbiddenFilenames(), |
| 31 | + 'forbidden_filename_characters' => $this->filenameValidator->getForbiddenCharacters(), |
| 32 | + 'forbidden_filename_extensions' => $this->filenameValidator->getForbiddenExtensions(), |
| 33 | + |
29 | 34 | 'bigfilechunking' => true, |
30 | | - 'blacklisted_files' => (array)$this->config->getSystemValue('blacklisted_files', ['.htaccess']), |
31 | | - 'forbidden_filename_characters' => \OCP\Util::getForbiddenFileNameChars(), |
32 | 35 | ], |
33 | 36 | ]; |
34 | 37 | } |
|
0 commit comments