From f4ede27cdbbb4f55bb963130295a28a89a833d94 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 15 Jul 2024 16:29:44 +0200 Subject: refactor: Remove deprecated `Util` function for filename validation to `FilenameValidator` Signed-off-by: Ferdinand Thiessen --- lib/private/legacy/OC_Util.php | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'lib/private/legacy/OC_Util.php') diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index b7836e86d7b..d8045e8343d 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -1036,35 +1036,6 @@ class OC_Util { return $version; } - /** - * 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 use \OC\Files\View::verifyPath() - */ - public static function isValidFileName($file) { - $trimmed = trim($file); - if ($trimmed === '') { - return false; - } - if (\OC\Files\Filesystem::isIgnoredDir($trimmed)) { - return false; - } - - // detect part files - if (preg_match('/' . \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX . '/', $trimmed) !== 0) { - return false; - } - - foreach (\OCP\Util::getForbiddenFileNameChars() as $char) { - if (str_contains($trimmed, $char)) { - return false; - } - } - return true; - } - /** * Check whether the instance needs to perform an upgrade, * either when the core version is higher or any app requires -- cgit v1.2.3