public function FilterHtml::setConfiguration in Drupal 9
Same name and namespace in other branches
- 8 core/modules/filter/src/Plugin/Filter/FilterHtml.php \Drupal\filter\Plugin\Filter\FilterHtml::setConfiguration()
Sets the configuration for this plugin instance.
Parameters
array $configuration: An associative array containing the plugin's configuration.
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\FilterCode
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;
}