From b07adddf39be60efe71c7a3ca2811e5c2108c563 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 9 Jan 2023 11:08:56 +0100 Subject: in the link reference provider, check if the link content type begins with text/html Signed-off-by: Julien Veyssier --- lib/private/Collaboration/Reference/LinkReferenceProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/private') diff --git a/lib/private/Collaboration/Reference/LinkReferenceProvider.php b/lib/private/Collaboration/Reference/LinkReferenceProvider.php index 583cbdcfe99..2cdfb2e0c91 100644 --- a/lib/private/Collaboration/Reference/LinkReferenceProvider.php +++ b/lib/private/Collaboration/Reference/LinkReferenceProvider.php @@ -116,7 +116,9 @@ class LinkReferenceProvider implements IReferenceProvider { return; } $linkContentType = $headResponse->getHeader('Content-Type'); - if ($linkContentType !== 'text/html') { + $expectedContentType = 'text/html'; + // check the header begins with the expected content type + if (substr($linkContentType, 0, strlen($expectedContentType)) !== $expectedContentType) { $this->logger->debug('Skip resolving links pointing to content type that is not "text/html"'); return; } -- cgit v1.2.3