You are here

public static function WebformHtmlEditor::getAllowedTags in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformHtmlEditor.php \Drupal\webform\Element\WebformHtmlEditor::getAllowedTags()

Get allowed tags.

Return value

array Allowed tags.

5 calls to WebformHtmlEditor::getAllowedTags()
Color::formatHtmlItem in src/Plugin/WebformElement/Color.php
Format an element's value as HTML.
template_preprocess_webform_element_more in includes/webform.theme.template.inc
Prepares variables for webform element more templates.
WebformHtmlEditor::checkMarkup in src/Element/WebformHtmlEditor.php
Runs HTML markup through (optional) text format.
WebformHtmlEditor::stripTags in src/Element/WebformHtmlEditor.php
Strip dis-allowed HTML tags from HTML text.
WebformHtmlHelper::toHtmlMarkup in src/Utility/WebformHtmlHelper.php
Convert string to safe HTML markup.

File

src/Element/WebformHtmlEditor.php, line 210

Class

WebformHtmlEditor
Provides a webform element for entering HTML using CodeMirror, TextFormat, or custom CKEditor.

Namespace

Drupal\webform\Element

Code

public static function getAllowedTags() {
  $allowed_tags = \Drupal::config('webform.settings')
    ->get('element.allowed_tags');
  switch ($allowed_tags) {
    case 'admin':
      return WebformXss::getAdminTagList();
    case 'html':
      return WebformXss::getHtmlTagList();
    default:
      return preg_split('/ +/', $allowed_tags);
  }
}