Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable25] Link reference provider: Improve content-type check #36053

Merged
merged 1 commit into from
Jan 11, 2023

Conversation

backportbot-nextcloud[bot]
Copy link

backport of #36043

@juliusknorr juliusknorr added the 4. to release Ready to be released and/or waiting for tests to finish label Jan 9, 2023
if ($linkContentType !== 'text/html') {
$expectedContentType = 'text/html';
// check the header begins with the expected content type
if (substr($linkContentType, 0, strlen($expectedContentType)) !== $expectedContentType) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should match "text/html;" with semicolon, otherwise "text/html5" or anything else would match as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value can also just be text/html so we would need to cover both cases:

  • value is exactly text/html
  • OR value starts with text/html;

Right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that

… with text/html

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@julien-nc julien-nc force-pushed the backport/36043/stable25 branch from 7dfb22d to e9dc352 Compare January 10, 2023 15:12
Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thanks for the adjustment

@PVince81 PVince81 merged commit c50b379 into stable25 Jan 11, 2023
@PVince81 PVince81 deleted the backport/36043/stable25 branch January 11, 2023 08:14
@blizzz blizzz mentioned this pull request Jan 11, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants