mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
in the link reference provider, check if the link content type begins with text/html
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
a398872711
commit
e9dc3526e9
1 changed files with 5 additions and 1 deletions
|
|
@ -116,7 +116,11 @@ class LinkReferenceProvider implements IReferenceProvider {
|
|||
return;
|
||||
}
|
||||
$linkContentType = $headResponse->getHeader('Content-Type');
|
||||
if ($linkContentType !== 'text/html') {
|
||||
$expectedContentType = 'text/html';
|
||||
$suffixedExpectedContentType = $expectedContentType . ';';
|
||||
$startsWithSuffixed = substr($linkContentType, 0, strlen($suffixedExpectedContentType)) === $suffixedExpectedContentType;
|
||||
// check the header begins with the expected content type
|
||||
if ($linkContentType !== $expectedContentType && !$startsWithSuffixed) {
|
||||
$this->logger->debug('Skip resolving links pointing to content type that is not "text/html"');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue