You are here

public function DirectoryFetcherForm::validateConfigurationForm in Feeds 8.3

Form validation handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides ExternalPluginFormBase::validateConfigurationForm

File

src/Feeds/Fetcher/Form/DirectoryFetcherForm.php, line 74

Class

DirectoryFetcherForm
Defines a directory fetcher.

Namespace

Drupal\feeds\Feeds\Fetcher\Form

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  $form_state
    ->setValue('allowed_schemes', array_filter($form_state
    ->getValue('allowed_schemes', [])));
  $extensions = preg_replace('/\\s+/', ' ', trim($form_state
    ->getValue('allowed_extensions', '')));
  $form_state
    ->setValue('allowed_extensions', $extensions);
}