summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2023-01-09 15:13:29 +0100
committerGitHub <noreply@github.com>2023-01-09 15:13:29 +0100
commit79f1c30a31f9453b119f9e9880a6308a86c78b39 (patch)
tree54f203b2ef35f33991e1235f71eb8984c2e8ca93
parent10ab0f2280b663acd55b0fa2c06f4490b01a908c (diff)
parentb07adddf39be60efe71c7a3ca2811e5c2108c563 (diff)
downloadnextcloud-server-79f1c30a31f9453b119f9e9880a6308a86c78b39.tar.gz
nextcloud-server-79f1c30a31f9453b119f9e9880a6308a86c78b39.zip
Merge pull request #36043 from nextcloud/fix/36042/link-reference-less-strict-content-type-check
Link reference provider: Improve content-type check
-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;
}