File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ class Filesystem {
3030
3131 private static ?CappedMemoryCache $ normalizedPathCache = null ;
3232
33- /** @var string[]|null */
34- private static ?array $ blacklist = null ;
33+ private static ?FilenameValidator $ validator = null ;
3534
3635 /**
3736 * classname which used for hooks handling
@@ -434,16 +433,16 @@ public static function isValidPath($path) {
434433 /**
435434 * @param string $filename
436435 * @return bool
436+ *
437+ * @deprecated 30.0.0 - use \OC\Files\FilenameValidator::isForbidden
437438 */
438439 public static function isFileBlacklisted ($ filename ) {
439- $ filename = self ::normalizePath ($ filename );
440-
441- if (self ::$ blacklist === null ) {
442- self ::$ blacklist = \OC ::$ server ->getConfig ()->getSystemValue ('blacklisted_files ' , ['.htaccess ' ]);
440+ if (self ::$ validator === null ) {
441+ self ::$ validator = \OCP \Server::get (FilenameValidator::class);
443442 }
444443
445- $ filename = strtolower ( basename ( $ filename) );
446- return in_array ( $ filename , self ::$ blacklist );
444+ $ filename = self :: normalizePath ( $ filename );
445+ return self ::$ validator -> isForbidden ( $ filename );
447446 }
448447
449448 /**
You can’t perform that action at this time.
0 commit comments