From 766447566a85b2068dd7b4412f7c2e9fd8472978 Mon Sep 17 00:00:00 2001 From: hgrobbel Date: Sun, 21 Dec 2025 01:15:02 +0100 Subject: [PATCH 1/2] fix(dav): avoid TypeError on public DAV HEAD range Signed-off-by: hgrobbel --- sabre/dav/lib/DAV/CorePlugin.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sabre/dav/lib/DAV/CorePlugin.php b/sabre/dav/lib/DAV/CorePlugin.php index dbd8976b1..96bc168ca 100644 --- a/sabre/dav/lib/DAV/CorePlugin.php +++ b/sabre/dav/lib/DAV/CorePlugin.php @@ -83,15 +83,15 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) $body = ''; } else { $body = $node->get(); - - // Converting string into stream, if needed. - if (is_string($body)) { - $stream = fopen('php://temp', 'r+'); - fwrite($stream, $body); - rewind($stream); - $body = $stream; - } } + // Converting string into stream, if needed. + if (is_string($body)) { + $stream = fopen('php://temp', 'r+'); + fwrite($stream, $body); + rewind($stream); + $body = $stream; + } + /* * TODO: getetag, getlastmodified, getsize should also be used using From 14407a50b0e67d7ed38965bf4c2906658802bfa3 Mon Sep 17 00:00:00 2001 From: hubimuc Date: Sun, 28 Dec 2025 22:20:37 +0100 Subject: [PATCH 2/2] Update sabre/dav/lib/DAV/CorePlugin.php OK for me Co-authored-by: Josh Signed-off-by: hubimuc --- sabre/dav/lib/DAV/CorePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sabre/dav/lib/DAV/CorePlugin.php b/sabre/dav/lib/DAV/CorePlugin.php index 96bc168ca..a402f5fd9 100644 --- a/sabre/dav/lib/DAV/CorePlugin.php +++ b/sabre/dav/lib/DAV/CorePlugin.php @@ -80,7 +80,7 @@ public function httpGet(RequestInterface $request, ResponseInterface $response) } if ('HEAD' === $request->getHeader('X-Sabre-Original-Method')) { - $body = ''; + $body = fopen('php://temp', 'r+'); } else { $body = $node->get(); }