mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
Merge pull request #34269 from nextcloud/td/noid/remove-unused-listener
remove listeners to OC_Filesystem::(write|rename) old style hooks
This commit is contained in:
commit
f323c5b854
2 changed files with 0 additions and 29 deletions
10
lib/base.php
10
lib/base.php
|
|
@ -745,7 +745,6 @@ class OC {
|
|||
}
|
||||
|
||||
self::registerCleanupHooks($systemConfig);
|
||||
self::registerFilesystemHooks();
|
||||
self::registerShareHooks($systemConfig);
|
||||
self::registerEncryptionWrapperAndHooks();
|
||||
self::registerAccountHooks();
|
||||
|
|
@ -917,15 +916,6 @@ class OC {
|
|||
\OC\Collaboration\Reference\File\FileReferenceEventListener::register(Server::get(IEventDispatcher::class));
|
||||
}
|
||||
|
||||
/**
|
||||
* register hooks for the filesystem
|
||||
*/
|
||||
public static function registerFilesystemHooks() {
|
||||
// Check for blacklisted files
|
||||
OC_Hook::connect('OC_Filesystem', 'write', Filesystem::class, 'isBlacklisted');
|
||||
OC_Hook::connect('OC_Filesystem', 'rename', Filesystem::class, 'isBlacklisted');
|
||||
}
|
||||
|
||||
/**
|
||||
* register hooks for sharing
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -488,25 +488,6 @@ class Filesystem {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* checks if a file is blacklisted for storage in the filesystem
|
||||
* Listens to write and rename hooks
|
||||
*
|
||||
* @param array $data from hook
|
||||
*/
|
||||
public static function isBlacklisted($data) {
|
||||
if (isset($data['path'])) {
|
||||
$path = $data['path'];
|
||||
} elseif (isset($data['newpath'])) {
|
||||
$path = $data['newpath'];
|
||||
}
|
||||
if (isset($path)) {
|
||||
if (self::isFileBlacklisted($path)) {
|
||||
$data['run'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $filename
|
||||
* @return bool
|
||||
|
|
|
|||
Loading…
Reference in a new issue