]> source.dussan.org Git - nextcloud-server.git/commitdiff
in the link reference provider, check if the link content type begins with text/html 36043/head
authorJulien Veyssier <julien-nc@posteo.net>
Mon, 9 Jan 2023 10:08:56 +0000 (11:08 +0100)
committerJulien Veyssier <julien-nc@posteo.net>
Mon, 9 Jan 2023 10:08:56 +0000 (11:08 +0100)
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
lib/private/Collaboration/Reference/LinkReferenceProvider.php

index 583cbdcfe997727eaf5ecb0e1872606fe04ea040..2cdfb2e0c91596c7104ebafc52e732f0912309cb 100644 (file)
@@ -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;
                }