You are here

protected function ConfigSplitEntityForm::filterConfigNames in Configuration Split 8

Same name and namespace in other branches
  1. 2.0.x src/Form/ConfigSplitEntityForm.php \Drupal\config_split\Form\ConfigSplitEntityForm::filterConfigNames()

Filter text input for valid configuration names (including wildcards).

Parameters

string|string[] $text: The configuration names, one name per line.

Return value

string[] The array of configuration names.

1 call to ConfigSplitEntityForm::filterConfigNames()
ConfigSplitEntityForm::submitForm in src/Form/ConfigSplitEntityForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…

File

src/Form/ConfigSplitEntityForm.php, line 327

Class

ConfigSplitEntityForm
The entity form.

Namespace

Drupal\config_split\Form

Code

protected function filterConfigNames($text) {
  if (!is_array($text)) {
    $text = explode("\n", $text);
  }
  foreach ($text as &$config_entry) {
    $config_entry = strtolower($config_entry);
  }

  // Filter out illegal characters.
  return array_filter(preg_replace('/[^a-z0-9_\\.\\-\\*]+/', '', $text));
}