\Horde_Text_Filter_Xss

This filter attempts to make HTML safe for viewing. IT IS NOT PERFECT. If you enable HTML viewing, you are opening a security hole.

Filter parameters:

  • charset: (string) The charset of the text. DEFAULT: UTF-8
  • noprefetch: (boolean) Disable DNS pre-fetching? See: https://developer.mozilla.org/En/Controlling_DNS_prefetching DEFAULT: false
  • return_document: (string) If true, returns a full HTML representation of the document. DEFAULT: false (returns the contents contained inside the BODY tag)
  • return_dom: (boolean) If true, return a Horde_Domhtml object instead of HTML text (overrides return_document). DEFAULT: false
  • strip_styles: (boolean) Strip style tags? DEFAULT: true
  • strip_style_attributes: (boolean) Strip style attributes in all tags? DEFAULT: true

Summary

Methods
Properties
Constants
__construct()
preProcess()
getPatterns()
postProcess()
No public properties found
No constants found
_node()
$_params
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Filter parameters.

Type

array

Methods

__construct()

__construct(array  $params = array()) 

Constructor.

Parameters

array $params

Any parameters that the filter instance needs.

preProcess()

preProcess(string  $text) : string

Executes any code necessaray before applying the filter patterns.

Parameters

string $text

The text before the filtering.

Returns

string —

The modified text.

getPatterns()

getPatterns() : array

Returns a hash with replace patterns.

Returns

array —

Patterns hash.

postProcess()

postProcess(string  $text) : string|\Horde_Domhtml

Executes any code necessary after applying the filter patterns.

Parameters

string $text

The text after the filtering.

Throws

\Exception

Returns

string|\Horde_Domhtml —

The modified text or a Domhtml object if the 'return_dom' parameter is set.

_node()

_node(\DOMElement  $node) : string

Process DOM node.

Parameters

\DOMElement $node

Element node.

Returns

string —

The plaintext representation.