Skip to content

Commit 9f55c47

Browse files
committed
Smartly remove custom collections that are already present
1 parent 20f334a commit 9f55c47

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

event/main_listener.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,12 @@ public function __construct(auth $auth, config $config, db_text $config_text, la
107107
*/
108108
public function add_custom_sites($event)
109109
{
110-
$phpbb4_builtins = array_flip([
111-
'applepodcasts',
112-
'bluesky',
113-
'bunny',
114-
'facebook',
115-
'mastodon',
116-
'pastebin',
117-
'threads',
118-
'twitter',
119-
'vk',
120-
]);
121-
122110
foreach ($this->custom_sites->get_collection() as $site)
123111
{
124112
$name = basename($site, ext::YML);
125113

126-
// Skip built-in sites when running phpBB 4
127-
if (isset($phpbb4_builtins[$name]) && $this->is_phpbb4())
114+
// Skip sites already defined as built-ins in phpBB 4
115+
if ($this->is_phpbb4() && $event['configurator']->MediaEmbed->defaultSites->exists($name))
128116
{
129117
continue;
130118
}

0 commit comments

Comments
 (0)