/** * Ask each sanitizer extension for default configuration * * @return array */ public function buildDefaultConfiguration() { $this->registerComponent(\Xoops\Core\Text\Sanitizer::getDefaultConfig()); $extensions = File::getList(__DIR__ . '/Extensions'); foreach ($extensions as $extensionFile) { if (substr($extensionFile, -4) === '.php') { $class = __NAMESPACE__ . '\\Extensions\\' . substr($extensionFile, 0, -4); if (is_a($class, 'Xoops\\Core\\Text\\Sanitizer\\SanitizerConfigurable', true)) { $this->registerComponent($class::getDefaultConfig()); } } } /** * Register any 3rd party extensions * * Listeners will be passed a Configuration object as the single argument, and should * call $arg->registerComponent() to register extensions * * All extensions must implement SanitizerConfigurable, extending either ExtensionAbstract * or FilterAbstract, and MUST autoload * * NB: Extensions and Filters all share the same configuration space, so a 3rd party * extension that has the same short name as system extension will override the system * supplied one. */ \Xoops::getInstance()->events()->triggerEvent('core.sanitizer.configuration.defaults', $this); return (array) $this; }