summaryrefslogtreecommitdiffstats
path: root/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php')
-rw-r--r--core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
index d77e37e..177ccdb 100644
--- a/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
+++ b/core/modules/filter/lib/Drupal/filter/Plugin/Filter/FilterHtml.php
@@ -68,6 +68,21 @@ class FilterHtml extends FilterBase {
/**
* {@inheritdoc}
*/
+ public function getHTMLRestrictions() {
+ $restrictions = array('allowed' => array());
+ $tags = preg_split('/\s+|<|>/', $this->settings['allowed_html'], -1, PREG_SPLIT_NO_EMPTY);
+ // List the allowed HTML tags.
+ foreach ($tags as $tag) {
+ $restrictions['allowed'][$tag] = TRUE;
+ }
+ // The 'style' and 'on*' ('onClick' etc.) attributes are always forbidden.
+ $restrictions['allowed']['*'] = array('style' => FALSE, 'on*' => FALSE);
+ return $restrictions;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function tips($long = FALSE) {
global $base_url;