2013-02-10 08:42:23 -05:00
|
|
|
<?php
|
2024-05-28 10:42:42 -04:00
|
|
|
|
2013-02-10 08:42:23 -05:00
|
|
|
/**
|
2024-05-28 10:42:42 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2013-02-10 08:42:23 -05:00
|
|
|
*/
|
2015-03-21 15:12:55 -04:00
|
|
|
namespace OCA\Files;
|
|
|
|
|
|
2024-07-10 10:59:26 -04:00
|
|
|
use OC\Files\FilenameValidator;
|
2015-03-21 15:12:55 -04:00
|
|
|
use OCP\Capabilities\ICapability;
|
|
|
|
|
|
|
|
|
|
class Capabilities implements ICapability {
|
2019-11-25 08:09:38 -05:00
|
|
|
|
2024-07-10 10:59:26 -04:00
|
|
|
public function __construct(
|
|
|
|
|
protected FilenameValidator $filenameValidator,
|
|
|
|
|
) {
|
2016-02-24 05:00:20 -05:00
|
|
|
}
|
2015-03-21 15:12:55 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return this classes capabilities
|
2023-06-14 08:43:41 -04:00
|
|
|
*
|
2024-07-15 13:10:52 -04:00
|
|
|
* @return array{files: array{'$comment': ?string, bigfilechunking: bool, blacklisted_files: array<mixed>, forbidden_filenames: list<string>, forbidden_filename_basenames: list<string>, forbidden_filename_characters: list<string>, forbidden_filename_extensions: list<string>}}
|
2015-03-21 15:12:55 -04:00
|
|
|
*/
|
2024-07-10 10:59:26 -04:00
|
|
|
public function getCapabilities(): array {
|
2015-03-21 15:12:55 -04:00
|
|
|
return [
|
|
|
|
|
'files' => [
|
2024-07-10 10:59:26 -04:00
|
|
|
'$comment' => '"blacklisted_files" is deprecated as of Nextcloud 30, use "forbidden_filenames" instead',
|
|
|
|
|
'blacklisted_files' => $this->filenameValidator->getForbiddenFilenames(),
|
|
|
|
|
'forbidden_filenames' => $this->filenameValidator->getForbiddenFilenames(),
|
2024-07-15 13:10:52 -04:00
|
|
|
'forbidden_filename_basenames' => $this->filenameValidator->getForbiddenBasenames(),
|
2024-07-10 10:59:26 -04:00
|
|
|
'forbidden_filename_characters' => $this->filenameValidator->getForbiddenCharacters(),
|
|
|
|
|
'forbidden_filename_extensions' => $this->filenameValidator->getForbiddenExtensions(),
|
|
|
|
|
|
2015-03-21 15:12:55 -04:00
|
|
|
'bigfilechunking' => true,
|
|
|
|
|
],
|
|
|
|
|
];
|
2013-02-10 08:42:23 -05:00
|
|
|
}
|
2013-08-18 05:02:08 -04:00
|
|
|
}
|