Skip to content

Commit b8419fd

Browse files
authored
Merge pull request #54315 from nextcloud/backport/54309/stable31
[stable31] fix: use correct return value for `has-preview` dav property
2 parents 077dcbb + c0e1d49 commit b8419fd

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

apps/files_trashbin/lib/Sabre/TrashbinPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public function propFind(PropFind $propFind, INode $node) {
104104
return $node->getFileId();
105105
});
106106

107-
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
108-
return $this->previewManager->isAvailable($node->getFileInfo());
107+
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, function () use ($node): string {
108+
return $this->previewManager->isAvailable($node->getFileInfo()) ? 'true' : 'false';
109109
});
110110

111111
$propFind->handle(FilesPlugin::MOUNT_TYPE_PROPERTYNAME, function () {

apps/files_versions/lib/Sabre/Plugin.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ public function propFind(PropFind $propFind, INode $node): void {
7878
if ($node instanceof VersionFile) {
7979
$propFind->handle(self::VERSION_LABEL, fn () => $node->getMetadataValue('label'));
8080
$propFind->handle(self::VERSION_AUTHOR, fn () => $node->getMetadataValue('author'));
81-
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, fn () => $this->previewManager->isMimeSupported($node->getContentType()));
81+
$propFind->handle(
82+
FilesPlugin::HAS_PREVIEW_PROPERTYNAME,
83+
fn (): string => $this->previewManager->isMimeSupported($node->getContentType()) ? 'true' : 'false',
84+
);
8285
}
8386
}
8487

0 commit comments

Comments
 (0)