diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-07-16 17:42:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-16 17:42:40 +0200 |
commit | 1b41e8f5661413c181a137c207ecaa9c394367bd (patch) | |
tree | a0b56a5456f3379661153599c784bbbe8cfa16d9 /lib/public | |
parent | decae5a45a93e0c16f748f38151575f8eb108d76 (diff) | |
parent | 322b3946d9b67de69792b70d9250d5285fe56954 (diff) | |
download | nextcloud-server-1b41e8f5661413c181a137c207ecaa9c394367bd.tar.gz nextcloud-server-1b41e8f5661413c181a137c207ecaa9c394367bd.zip |
Merge pull request #46538 from nextcloud/fix/use-filename-validator
refactor: Migrate filename validation from `Storage` and `Util` to `FilenameValidator`
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Util.php | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/public/Util.php b/lib/public/Util.php index 4cee9addf10..17794810c1a 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -18,7 +18,6 @@ use OCP\L10N\IFactory; use OCP\Mail\IMailer; use OCP\Share\IManager; use Psr\Container\ContainerExceptionInterface; -use Psr\Log\LoggerInterface; /** * This class provides different helper functions to make the life of a developer easier @@ -489,39 +488,6 @@ class Util { } /** - * Get a list of characters forbidden in file names - * @return string[] - * @since 29.0.0 - */ - public static function getForbiddenFileNameChars(): array { - // Get always forbidden characters - $invalidChars = str_split(\OCP\Constants::FILENAME_INVALID_CHARS); - if ($invalidChars === false) { - $invalidChars = []; - } - - // Get admin defined invalid characters - $additionalChars = \OCP\Server::get(IConfig::class)->getSystemValue('forbidden_chars', []); - if (!is_array($additionalChars)) { - \OCP\Server::get(LoggerInterface::class)->error('Invalid system config value for "forbidden_chars" is ignored.'); - $additionalChars = []; - } - return array_merge($invalidChars, $additionalChars); - } - - /** - * Returns whether the given file name is valid - * @param string $file file name to check - * @return bool true if the file name is valid, false otherwise - * @deprecated 8.1.0 use OCP\Files\Storage\IStorage::verifyPath() - * @since 7.0.0 - * @suppress PhanDeprecatedFunction - */ - public static function isValidFileName($file) { - return \OC_Util::isValidFileName($file); - } - - /** * Compare two strings to provide a natural sort * @param string $a first string to compare * @param string $b second string to compare |