- 🇧🇪Belgium sfcamil
THX,
Working well for me with just two small modifications:
validateConfigurationForm it's not called for me (why?) so I moved the code (Store the trimmed domains as an array) in submitConfigurationForm:public function submitConfigurationForm(array &$form, FormStateInterface $form_state) { // Store the trimmed domains as an array. $domains = explode(PHP_EOL, $form_state->getValue('domains')); $form_state->setValue('domains', array_filter(array_map('trim', $domains))); $this->configuration['domains'] = $form_state->getValue('domains'); parent::submitConfigurationForm($form, $form_state); }
Changed in evaluate (mb_strtolower)
$host = mb_strtolower($this->requestStack->getCurrentRequest()->getHost()); return in_array($host, array_map('mb_strtolower', $domains));