You are here

class WebformXss in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformXss.php \Drupal\webform\Utility\WebformXss

Provides webform helper to filter for cross-site scripting.

Hierarchy

Expanded class hierarchy of WebformXss

3 files declare their use of WebformXss
WebformComputedBase.php in src/Element/WebformComputedBase.php
WebformHtmlEditor.php in src/Element/WebformHtmlEditor.php
WebformTwigExtension.php in src/Twig/WebformTwigExtension.php

File

src/Utility/WebformXss.php, line 10

Namespace

Drupal\webform\Utility
View source
class WebformXss {

  /**
   * Gets the list of HTML tags allowed by Xss::filterAdmin() with missing <label>, <fieldset>, <legend>, <font> tags.
   *
   * @return array
   *   The list of HTML tags allowed by filterAdmin() with missing
   *   <label>, <fieldset>, <legend>, <font> tags.
   */
  public static function getAdminTagList() {
    $allowed_tags = Xss::getAdminTagList();
    $allowed_tags[] = 'label';
    $allowed_tags[] = 'fieldset';
    $allowed_tags[] = 'legend';
    $allowed_tags[] = 'font';
    return $allowed_tags;
  }

  /**
   * Gets the standard list of HTML tags allowed by Xss::filter() with missing <font> tag.
   *
   * @return array
   *   The list of HTML tags allowed by Xss::filter() with missing <font> tag.
   */
  public static function getHtmlTagList() {
    $allowed_tags = Xss::getHtmlTagList();
    $allowed_tags[] = 'font';
    return $allowed_tags;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WebformXss::getAdminTagList public static function Gets the list of HTML tags allowed by Xss::filterAdmin() with missing <label>, <fieldset>, <legend>, <font> tags.
WebformXss::getHtmlTagList public static function Gets the standard list of HTML tags allowed by Xss::filter() with missing <font> tag.