Skip to content

Commit

Permalink
[TASK] Use no-cookie setting for vimeo by default
Browse files Browse the repository at this point in the history
Improve the privacy of users by using the no-cookie setting
by default and set the do not track parameter to 1.

Resolves: #89381
Releases: master, 9.5
Change-Id: I81d1a6aae802126f66765702417b7ffd350d8fb7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61948
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Benni Mack <benni@typo3.org>
  • Loading branch information
brandung-gs authored and bmack committed Mar 17, 2020
1 parent decea21 commit 74ac002
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Expand Up @@ -144,6 +144,9 @@ protected function createVimeoUrl(array $options, FileInterface $file)
if (isset($options['api']) && (int)$options['api'] === 1) {
$urlParams[] = 'api=1';
}
if (!empty($options['no-cookie'])) {
$urlParams[] = 'dnt=1';
}
$urlParams[] = 'title=' . (int)!empty($options['showinfo']);
$urlParams[] = 'byline=' . (int)!empty($options['showinfo']);
$urlParams[] = 'portrait=0';
Expand Down
Expand Up @@ -283,4 +283,18 @@ public function renderOutputWithApiIsCorrect()
$this->subject->render($fileResourceMock, '300m', '200', ['api' => 1])
);
}

/**
* @test
*/
public function renderOutputWithDisabledNoCookieIsCorrect()
{
/** @var File|\PHPUnit_Framework_MockObject_MockObject $fileResourceMock */
$fileResourceMock = $this->createMock(File::class);

self::assertSame(
'<iframe src="https://player.vimeo.com/video/7331?api=1&amp;dnt=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200" allow="fullscreen"></iframe>',
$this->subject->render($fileResourceMock, '300m', '200', ['api' => 1, 'no-cookie' => 1])
);
}
}

0 comments on commit 74ac002

Please sign in to comment.