Procházet zdrojové kódy

improve link reference content-type check, accept 'text/html;*'

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
tags/v26.0.0beta1
Julien Veyssier před 1 rokem
rodič
revize
f0589523c8
Žádný účet není propojen s e-mailovou adresou tvůrce revize

+ 3
- 1
lib/private/Collaboration/Reference/LinkReferenceProvider.php Zobrazit soubor

@@ -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;
}

Načítá se…
Zrušit
Uložit