You are here

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

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

Strip dis-allowed HTML tags from HTML text.

Parameters

string $text: HTML text.

Return value

string HTML text with dis-allowed HTML tags removed.

3 calls to WebformHtmlEditor::stripTags()
template_preprocess_webform_element_help in includes/webform.theme.template.inc
Prepares variables for webform element help templates.
TextBase::prepare in src/Plugin/WebformElement/TextBase.php
Prepare an element to be rendered within a webform.
WebformImageSelect::setOptions in modules/webform_image_select/src/Element/WebformImageSelect.php
Set element #options from #images.

File

src/Element/WebformHtmlEditor.php, line 275

Class

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

Namespace

Drupal\webform\Element

Code

public static function stripTags($text) {
  $allowed_tags = '<' . implode('><', static::getAllowedTags()) . '>';
  return strip_tags($text, $allowed_tags);
}