function FilterHtml::setConfiguration

Same name in other branches
  1. 9 core/modules/filter/src/Plugin/Filter/FilterHtml.php \Drupal\filter\Plugin\Filter\FilterHtml::setConfiguration()
  2. 8.9.x core/modules/filter/src/Plugin/Filter/FilterHtml.php \Drupal\filter\Plugin\Filter\FilterHtml::setConfiguration()
  3. 11.x core/modules/filter/src/Plugin/Filter/FilterHtml.php \Drupal\filter\Plugin\Filter\FilterHtml::setConfiguration()

Overrides FilterBase::setConfiguration

File

core/modules/filter/src/Plugin/Filter/FilterHtml.php, line 70

Class

FilterHtml
Provides a filter to limit allowed HTML tags.

Namespace

Drupal\filter\Plugin\Filter

Code

public function setConfiguration(array $configuration) {
    if (isset($configuration['settings']['allowed_html'])) {
        // The javascript in core/modules/filter/filter.filter_html.admin.js
        // removes new lines and double spaces so, for consistency when javascript
        // is disabled, remove them.
        $configuration['settings']['allowed_html'] = preg_replace('/\\s+/', ' ', $configuration['settings']['allowed_html']);
    }
    parent::setConfiguration($configuration);
    // Force restrictions to be calculated again.
    $this->restrictions = NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.