aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Collaboration
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2023-01-09 11:08:56 +0100
committerJulien Veyssier <julien-nc@posteo.net>2023-01-09 11:08:56 +0100
commitb07adddf39be60efe71c7a3ca2811e5c2108c563 (patch)
treeb245dc642dc27afde3c7dab66dd47219bf86f0f5 /lib/private/Collaboration
parentff0a32f70f10b7c78ae1940135bb555ca1b05f6d (diff)
downloadnextcloud-server-b07adddf39be60efe71c7a3ca2811e5c2108c563.tar.gz
nextcloud-server-b07adddf39be60efe71c7a3ca2811e5c2108c563.zip
in the link reference provider, check if the link content type begins with text/html
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'lib/private/Collaboration')
-rw-r--r--lib/private/Collaboration/Reference/LinkReferenceProvider.php4
1 files changed, 3 insertions, 1 deletions
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;
}