From 82da99937d3f9356b492b793f35ad77a98b37df6 Mon Sep 17 00:00:00 2001 From: Alma Armas Date: Mon, 18 Jan 2021 16:44:53 +0000 Subject: [PATCH] Fix mystery bug --- chandler/Extensions/ExtensionManager.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chandler/Extensions/ExtensionManager.php b/chandler/Extensions/ExtensionManager.php index 1f4f5e6..875ebff 100644 --- a/chandler/Extensions/ExtensionManager.php +++ b/chandler/Extensions/ExtensionManager.php @@ -70,8 +70,11 @@ class ExtensionManager define(str_replace("-", "_", mb_strtoupper($name)) . "_ROOT", CHANDLER_ROOT . "/extensions/enabled/$name", false); define(str_replace("-", "_", mb_strtoupper($name)) . "_ROOT_CONF", chandler_parse_yaml(CHANDLER_ROOT . "/extensions/enabled/$name/$name.yml"), false); - if(isset($configuration->init)) - (require(CHANDLER_ROOT . "/extensions/enabled/$name/" . $configuration->init))(); + if(isset($configuration->init)) { + $init = require(CHANDLER_ROOT . "/extensions/enabled/$name/" . $configuration->init); + if(is_callable($init)) + $init(); + } if(is_dir($hooks = CHANDLER_EXTENSIONS_ENABLED . "/$name/Hooks")) { foreach(Finder::findFiles("*Hook.php")->in($hooks) as $hookFile) {