diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index ae3caa29b919e..709a4cd68ed8f 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -465,13 +465,17 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) $requestProperties = $propFind->getRequestedProperties(); - if ($this->config->getSystemValueBool('enable_file_metadata', true)) { - $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