diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index e50afa81650..f1e97eaad13 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -129,7 +129,10 @@ public function create(?int $fileId = null, ?string $filePath = null, ?string $b $hasOwner = $file->getOwner() !== null; - if (!$readOnly) { + // Disable file locking for Readme.md files, because in the + // current setup, this makes it almost impossible to delete these files. + /** @psalm-suppress RedundantCastGivenDocblockType */ + if (!$readOnly && strcasecmp((string)$file->getName(), 'Readme.md') !== 0) { $isLocked = $this->documentService->lock($file->getId()); if (!$isLocked) { $readOnly = true;