Switch to a whitelist for enabling extensions

This commit is contained in:
Franz Liedke 2019-01-22 21:56:39 +01:00
parent bc9e8f68f1
commit 4585f03ee3
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -67,12 +67,21 @@ class EnableBundledExtensions implements Step
);
}
const DISABLED_EXTENSIONS = [
'flarum-akismet',
'flarum-auth-facebook',
'flarum-auth-github',
'flarum-auth-twitter',
'flarum-pusher',
const EXTENSION_WHITELIST = [
'flarum-approval',
'flarum-bbcode',
'flarum-emoji',
'flarum-lang-english',
'flarum-flags',
'flarum-likes',
'flarum-lock',
'flarum-markdown',
'flarum-mentions',
'flarum-statistics',
'flarum-sticky',
'flarum-subscriptions',
'flarum-suspend',
'flarum-tags',
];
/**
@ -93,7 +102,7 @@ class EnableBundledExtensions implements Step
return $extension;
})->filter(function (Extension $extension) {
return ! in_array($extension->getId(), self::DISABLED_EXTENSIONS);
return in_array($extension->getId(), self::EXTENSION_WHITELIST);
})->sortBy(function (Extension $extension) {
return $extension->composerJsonAttribute('extra.flarum-extension.title');
})->mapWithKeys(function (Extension $extension) {