From 631ae17dce8335d8cdb4669060cd828efe6b294d Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 14 Mar 2019 14:46:39 +0100 Subject: [PATCH] handle long etags from dav external storage we can only store etags up to 40 characters long in the database, so when we get an etag that's longer we simply hash it to bring down the length Signed-off-by: Robin Appelman --- lib/private/Files/Storage/DAV.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index abb76660ca..52ed890056 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -726,7 +726,11 @@ class DAV extends Common { return null; } if (isset($response['{DAV:}getetag'])) { - return trim($response['{DAV:}getetag'], '"'); + $etag = trim($response['{DAV:}getetag'], '"'); + if (strlen($etag) > 40) { + $etag = md5($etag); + } + return $etag; } return parent::getEtag($path); }