From 76acc3ada729127c3d7eb50f03bcb2a0a56dac66 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 14 Aug 2023 13:01:14 +0200 Subject: only triger metadata preload logic when at least one metadata is requested Signed-off-by: Robin Appelman --- apps/dav/lib/Connector/Sabre/FilesPlugin.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'apps/dav') diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 7d7b27df890..709a4cd68ed 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -465,13 +465,17 @@ class FilesPlugin extends ServerPlugin { $requestProperties = $propFind->getRequestedProperties(); - if ($this->config->getSystemValueBool('enable_file_metadata', true) && $propFind->getDepth() === 1) { - $requestedMetaData = []; - foreach ($requestProperties as $requestProperty) { - if (isset(self::ALL_METADATA_PROPS[$requestProperty])) { - $requestedMetaData[] = self::ALL_METADATA_PROPS[$requestProperty]; - } + $requestedMetaData = []; + foreach ($requestProperties as $requestProperty) { + if (isset(self::ALL_METADATA_PROPS[$requestProperty])) { + $requestedMetaData[] = self::ALL_METADATA_PROPS[$requestProperty]; } + } + if ( + $this->config->getSystemValueBool('enable_file_metadata', true) && + $propFind->getDepth() === 1 && + $requestedMetaData + ) { $children = $node->getChildren(); // Preloading of the metadata -- cgit v1.2.3