aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Configuration.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-06-09 15:58:18 +0200
committerGravatar GitHub <noreply@github.com> 2018-06-09 15:58:18 +0200
commit6a56894e940db0b1f7ee6788fbc38f26c80d004d (patch)
treea0ef3d306ee3f0aa02a7addbb743af9863565691 /lib/Minz/Configuration.php
parent32676d59a386fe067ae0beac0287c700274f3d57 (diff)
New extension event + Tumblr GDPR (#1924)
* New extension event + Tumblr GDPR https://github.com/FreshRSS/FreshRSS/issues/1894 simplepie_before_init event * Refactor extension enabling + Tumblr GDPR enabled by default Add possibility for extensions to be enabled by default, and disabled back by users. * Minor whitespace
Diffstat (limited to 'lib/Minz/Configuration.php')
-rw-r--r--lib/Minz/Configuration.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php
index 5470dc85f..3e486d68e 100644
--- a/lib/Minz/Configuration.php
+++ b/lib/Minz/Configuration.php
@@ -90,15 +90,15 @@ class Minz_Configuration {
private $configuration_setter = null;
public function removeExtension($ext_name) {
- self::$extensions_enabled = array_diff(
- self::$extensions_enabled,
- array($ext_name)
- );
+ unset(self::$extensions_enabled[$ext_name]);
+ $legacyKey = array_search($ext_name, self::$extensions_enabled, true);
+ if ($legacyKey !== false) { //Legacy format FreshRSS < 1.11.1
+ unset(self::$extensions_enabled[$legacyKey]);
+ }
}
public function addExtension($ext_name) {
- $found = array_search($ext_name, self::$extensions_enabled) !== false;
- if (!$found) {
- self::$extensions_enabled[] = $ext_name;
+ if (!isset(self::$extensions_enabled[$ext_name])) {
+ self::$extensions_enabled[$ext_name] = true;
}
}