From f0589523c80749b1bdfbbfea34b141cd562e216b Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Tue, 10 Jan 2023 16:17:52 +0100 Subject: [PATCH] improve link reference content-type check, accept 'text/html;*' Signed-off-by: Julien Veyssier --- lib/private/Collaboration/Reference/LinkReferenceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/Collaboration/Reference/LinkReferenceProvider.php b/lib/private/Collaboration/Reference/LinkReferenceProvider.php index 2cdfb2e0c91..2a6d4d5afaf 100644 --- a/lib/private/Collaboration/Reference/LinkReferenceProvider.php +++ b/lib/private/Collaboration/Reference/LinkReferenceProvider.php @@ -117,8 +117,10 @@ class LinkReferenceProvider implements IReferenceProvider { } $linkContentType = $headResponse->getHeader('Content-Type'); $expectedContentType = 'text/html'; + $suffixedExpectedContentType = $expectedContentType . ';'; + $startsWithSuffixed = substr($linkContentType, 0, strlen($suffixedExpectedContentType)) === $suffixedExpectedContentType; // check the header begins with the expected content type - if (substr($linkContentType, 0, strlen($expectedContentType)) !== $expectedContentType) { + if ($linkContentType !== $expectedContentType && !$startsWithSuffixed) { $this->logger->debug('Skip resolving links pointing to content type that is not "text/html"'); return; } -- 2.39.5