aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Util.php
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-07-15 16:29:44 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-07-16 12:49:10 +0200
commitf4ede27cdbbb4f55bb963130295a28a89a833d94 (patch)
treefefcca04d1fff7e897e13da0ac3fcc4bef70a3d4 /lib/private/legacy/OC_Util.php
parent69341e4306259430533cf66fd0a76688c7c8e6ab (diff)
downloadnextcloud-server-f4ede27cdbbb4f55bb963130295a28a89a833d94.tar.gz
nextcloud-server-f4ede27cdbbb4f55bb963130295a28a89a833d94.zip
refactor: Remove deprecated `Util` function for filename validation to `FilenameValidator`
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib/private/legacy/OC_Util.php')
-rw-r--r--lib/private/legacy/OC_Util.php29
1 files changed, 0 insertions, 29 deletions
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
@@ -1037,35 +1037,6 @@ class OC_Util {
}
/**
- * 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
* an upgrade.