Skip to content

Commit

Permalink
Switch to a whitelist for enabling extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
franzliedke committed Jan 31, 2019
1 parent bc9e8f6 commit 4585f03
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/Install/Steps/EnableBundledExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,21 @@ public function run()
);
}

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',
];

/**
Expand All @@ -93,7 +102,7 @@ private function loadExtensions()

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) {
Expand Down

0 comments on commit 4585f03

Please sign in to comment.