diff options
author | Hugo Gonzalez Labrador <hglavra@gmail.com> | 2015-05-06 10:39:48 +0200 |
---|---|---|
committer | Hugo Gonzalez Labrador <hglavra@gmail.com> | 2015-05-06 10:39:48 +0200 |
commit | 3e647afbd43a40d85b7ef97eca0fe5038661d174 (patch) | |
tree | 03a9378f874946bfbddc8349700f4017e36270fe /lib | |
parent | 3a3a58f24839cc14b726cb8a272847d0b4f4153e (diff) | |
download | nextcloud-server-3e647afbd43a40d85b7ef97eca0fe5038661d174.tar.gz nextcloud-server-3e647afbd43a40d85b7ef97eca0fe5038661d174.zip |
Do not trigger preview hooks if enable_previews is false
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/base.php b/lib/base.php index ae87b341427..a9d582dcc39 100644 --- a/lib/base.php +++ b/lib/base.php @@ -654,7 +654,9 @@ class OC { self::registerCacheHooks(); self::registerFilesystemHooks(); - self::registerPreviewHooks(); + if (\OC::$server->getSystemConfig()->getValue('enable_previews', false)) { + self::registerPreviewHooks(); + } self::registerShareHooks(); self::registerLogRotate(); self::registerLocalAddressBook(); @@ -766,15 +768,13 @@ class OC { * register hooks for previews */ public static function registerPreviewHooks() { - if (\OC::$server->getSystemConfig()->getValue('enable_previews', false)) { - OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write'); - OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'prepare_delete_files'); - OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete'); - OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete'); - OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files'); - OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete'); - OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete'); - } + OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write'); + OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'prepare_delete_files'); + OC_Hook::connect('\OCP\Versions', 'preDelete', 'OC\Preview', 'prepare_delete'); + OC_Hook::connect('\OCP\Trashbin', 'preDelete', 'OC\Preview', 'prepare_delete'); + OC_Hook::connect('OC_Filesystem', 'post_delete', 'OC\Preview', 'post_delete_files'); + OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete'); + OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete'); } /** |