Skip to content

Commit 79ce9b8

Browse files
committed
Change youtube referrer policy only for phpbb 3
1 parent a8340b6 commit 79ce9b8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

event/main_listener.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ public function modify_tag_templates($event)
177177
{
178178
// force YouTube to use the no cookies until the user starts video playback, and fix referrer policy issues
179179
$tag = $event['configurator']->tags['YOUTUBE'];
180-
$tag->template = str_replace(['www.youtube.com', ' allowfullscreen'], ['www.youtube-nocookie.com', ' referrerpolicy="origin" allowfullscreen'], $tag->template);
180+
$tag->template = str_replace(['www.youtube.com'], 'www.youtube-nocookie.com', $tag->template);
181+
if (!$this->is_phpbb4())
182+
{
183+
$tag->template = str_replace([' allowfullscreen'], ' referrerpolicy="origin" allowfullscreen', $tag->template);
184+
}
181185

182186
$event['configurator']->finalize();
183187
}

0 commit comments

Comments
 (0)