string = Html::normalize(Xss::filter($string, static::allowedTags())); return $safe_string; } /** * Returns the allowed tag list. * * @return string[] * A list of allowed tags. */ public static function allowedTags() { return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img']; } /** * Returns a human-readable list of allowed tags for display in help texts. * * @return string * A human-readable list of allowed tags for display in help texts. */ public static function displayAllowedTags() { return '<' . implode('> <', static::allowedTags()) . '>'; } }