[TASK] Always use HTTPS for youtube and vimeo 09/50009/2
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 20 Sep 2016 06:55:08 +0000 (08:55 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 22 Sep 2016 20:22:35 +0000 (22:22 +0200)
As youtube and vimeo run absolutly fine on HTTPS, there is no reason
to use plain HTTP.

Resolves: #77998
Releases: master, 7.6
Change-Id: I4326b7b51d51143eab6791688c8a4cdc070fd451
Reviewed-on: https://review.typo3.org/50009
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Resource/Rendering/VimeoRenderer.php
typo3/sysext/core/Classes/Resource/Rendering/YouTubeRenderer.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php
typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php

index ffdfc4c..2c2b120 100644 (file)
@@ -115,7 +115,7 @@ class VimeoRenderer implements FileRendererInterface
         }
 
         $videoId = $this->getOnlineMediaHelper($file)->getOnlineMediaId($orgFile);
-        $src = sprintf('//player.vimeo.com/video/%s?%s', $videoId, implode('&amp;', $urlParams));
+        $src = sprintf('https://player.vimeo.com/video/%s?%s', $videoId, implode('&amp;', $urlParams));
 
         $attributes = ['allowfullscreen'];
         if ((int)$width > 0) {
index 15bff8b..a7bbfa7 100644 (file)
@@ -120,7 +120,7 @@ class YouTubeRenderer implements FileRendererInterface
 
         $videoId = $this->getOnlineMediaHelper($file)->getOnlineMediaId($orgFile);
         $src = sprintf(
-            '//www.youtube%s.com/embed/%s?%s',
+            'https://www.youtube%s.com/embed/%s?%s',
             !empty($options['no-cookie']) ? '-nocookie' : '',
             $videoId,
             implode('&amp;', $urlParams)
index e96eb95..c2e91db 100644 (file)
@@ -91,7 +91,7 @@ class VimeoRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//player.vimeo.com/video/7331?title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://player.vimeo.com/video/7331?title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200')
         );
     }
@@ -105,7 +105,7 @@ class VimeoRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//player.vimeo.com/video/7331?loop=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://player.vimeo.com/video/7331?loop=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200', ['loop' => 1])
         );
     }
@@ -119,7 +119,7 @@ class VimeoRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//player.vimeo.com/video/7331?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://player.vimeo.com/video/7331?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200', ['autoplay' => 1])
         );
     }
@@ -138,7 +138,7 @@ class VimeoRendererTest extends UnitTestCase
         $fileReferenceMock->expects($this->any())->method('getOriginalFile')->willReturn($fileResourceMock);
 
         $this->assertSame(
-            '<iframe src="//player.vimeo.com/video/7331?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://player.vimeo.com/video/7331?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileReferenceMock, '300m', '200')
         );
     }
@@ -152,7 +152,7 @@ class VimeoRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//player.vimeo.com/video/7331?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://player.vimeo.com/video/7331?autoplay=1&amp;title=0&amp;byline=0&amp;portrait=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200', ['autoplay' => 1])
         );
     }
index 77a6655..21de866 100644 (file)
@@ -95,7 +95,7 @@ class YouTubeRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200')
         );
     }
@@ -109,7 +109,7 @@ class YouTubeRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;loop=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;loop=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200', ['loop' => 1])
         );
     }
@@ -123,7 +123,7 @@ class YouTubeRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;autoplay=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;autoplay=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200', ['autoplay' => 1])
         );
     }
@@ -142,7 +142,7 @@ class YouTubeRendererTest extends UnitTestCase
         $fileReferenceMock->expects($this->any())->method('getOriginalFile')->willReturn($fileResourceMock);
 
         $this->assertSame(
-            '<iframe src="//www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;autoplay=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://www.youtube.com/embed/7331?autohide=1&amp;controls=2&amp;autoplay=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileReferenceMock, '300m', '200')
         );
     }
@@ -156,7 +156,7 @@ class YouTubeRendererTest extends UnitTestCase
         $fileResourceMock = $this->getMock(File::class, [], [], '', false);
 
         $this->assertSame(
-            '<iframe src="//www.youtube.com/embed/7331?autohide=1&amp;autoplay=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
+            '<iframe src="https://www.youtube.com/embed/7331?autohide=1&amp;autoplay=1&amp;enablejsapi=1&amp;origin=http://test.server.org/test-page/&amp;showinfo=0" allowfullscreen width="300" height="200"></iframe>',
             $this->subject->render($fileResourceMock, '300m', '200', ['controls' => 0, 'autoplay' => 1])
         );
     }