Skip to content

Commit ae4fdef

Browse files
authored
Merge pull request #54314 from nextcloud/backport/54309/stable30
[stable30] fix: use correct return value for `has-preview` dav property
2 parents 17e97e6 + b9f8322 commit ae4fdef

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

apps/files_trashbin/lib/Sabre/TrashbinPlugin.php

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

114-
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
115-
return $this->previewManager->isAvailable($node->getFileInfo());
114+
$propFind->handle(FilesPlugin::HAS_PREVIEW_PROPERTYNAME, function () use ($node): string {
115+
return $this->previewManager->isAvailable($node->getFileInfo()) ? 'true' : 'false';
116116
});
117117

118118
$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)