Skip to content

Commit 4078e2f

Browse files
authored
Merge pull request #115 from iMattPro/privacy-updates
Add privacy enhancements
2 parents fcb673b + cb0a77f commit 4078e2f

File tree

22 files changed

+653
-4
lines changed

22 files changed

+653
-4
lines changed

event/main_listener.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class main_listener implements EventSubscriberInterface
6161
public static function getSubscribedEvents()
6262
{
6363
return [
64-
'core.text_formatter_s9e_configure_after' => [['add_custom_sites', 3], ['enable_media_sites', 2], ['configure_url_parsing', 1]],
64+
'core.text_formatter_s9e_configure_after' => [['add_custom_sites', 3], ['enable_media_sites', 2], ['configure_url_parsing', 1], ['modify_tag_templates', 0]],
6565
'core.display_custom_bbcodes' => 'setup_media_bbcode',
6666
'core.permissions' => 'set_permissions',
6767
'core.help_manager_add_block_before' => 'media_embed_help',
@@ -70,6 +70,7 @@ public static function getSubscribedEvents()
7070
'core.message_parser_check_message' => [['check_signature'], ['check_magic_urls'], ['check_bbcode_enabled']],
7171
'core.text_formatter_s9e_parser_setup' => [['disable_media_embed'], ['setup_cache_dir']],
7272
'core.page_header' => 'setup_media_configs',
73+
'core.page_footer' => 'append_agreement',
7374
];
7475
}
7576

@@ -155,6 +156,28 @@ public function configure_url_parsing($event)
155156
}
156157
}
157158

159+
/**
160+
* Modify bbcode tag templates
161+
*
162+
* @param \phpbb\event\data $event The event object
163+
* @return void
164+
*/
165+
public function modify_tag_templates($event)
166+
{
167+
try
168+
{
169+
// force YouTube to use the no cookies until the user starts video playback
170+
$tag = $event['configurator']->tags['YOUTUBE'];
171+
$tag->template = str_replace('www.youtube.com', 'www.youtube-nocookie.com', $tag->template);
172+
173+
$event['configurator']->finalize();
174+
}
175+
catch (\RuntimeException $e)
176+
{
177+
// do nothing
178+
}
179+
}
180+
158181
/**
159182
* Set template switch for displaying the [media] BBCode button
160183
*
@@ -344,4 +367,21 @@ protected function get_siteIds()
344367

345368
return $siteIds ? json_decode($siteIds, true) : [];
346369
}
370+
371+
/**
372+
* Appends additional language to the privacy policy agreement text.
373+
*
374+
* @return void
375+
*/
376+
public function append_agreement()
377+
{
378+
if (!$this->template->retrieve_var('S_AGREEMENT') || ($this->template->retrieve_var('AGREEMENT_TITLE') !== $this->language->lang('PRIVACY')))
379+
{
380+
return;
381+
}
382+
383+
$this->language->add_lang('ucp', 'phpbb/mediaembed');
384+
385+
$this->template->append_var('AGREEMENT_TEXT', $this->language->lang('MEDIA_EMBED_PRIVACY_POLICY', $this->config['sitename']));
386+
}
347387
}

language/ar/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/cs/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/da/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/de/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/en/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/es/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/es_x_tu/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/et/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

language/fr/ucp.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
*
4+
* phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2025 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
if (!defined('IN_PHPBB'))
12+
{
13+
exit;
14+
}
15+
16+
if (empty($lang) || !is_array($lang))
17+
{
18+
$lang = [];
19+
}
20+
21+
$lang = array_merge($lang, [
22+
'MEDIA_EMBED_PRIVACY_POLICY' => '
23+
<br><br>
24+
<h3>Embedded Content from Other Websites</h3>
25+
“%1$s” may include posts or content that contain embedded material from external websites, including but not limited to YouTube, Facebook, Twitter, and similar platforms. Embedded content from these external sites behaves in the same way as if you had visited the originating website directly.
26+
<br><br>These external websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with the embedded content, including tracking your interaction if you have an account and are logged in to that website.
27+
<br><br>Please note that such activity is beyond the control of “%1$s” and is governed by the privacy policies and terms of service of the respective external websites. We encourage you to review the privacy and cookie policies of any third-party services you interact with through embedded content.
28+
',
29+
]);

0 commit comments

Comments
 (0)