rcube_washtml

Utility class providing HTML sanityzer

package

Framework

subpackage

Utils

Methods

Class constructor

__construct( $p = array()) 

Arguments

$p

Register a callback function for a certain tag

add_callback( $tagName,  $callback) 

Arguments

$tagName

$callback

Clean HTML input

cleanup( $html) 

Arguments

$html

The main loop that recurse on a node tree.

dumpHtml(\DOMNode $node, integer $level = 20) 

It output only allowed tags with allowed attributes and allowed inline styles

Arguments

$node

\DOMNode

HTML element

$level

integer

Recurrence level (safe initial value found empirically)

Explode css style value

explode_style( $style) 

Arguments

$style

Fix broken nested lists, they are not handled properly by DOMDocument (#1488768)

fix_broken_lists( &$html) 
static

Arguments

$html

Getter for config parameters

get_config( $prop) 

Arguments

$prop

Callback function for HTML tags fixing

html_tag_callback( $matches) 
static

Arguments

$matches

Check it the tag/attribute may contain a FUNCIRI value

is_funciri_attribute( $tag,  $attr) 

Arguments

$tag

$attr

Check it the tag/attribute may contain an image URI

is_image_attribute( $tag,  $attr) 

Arguments

$tag

$attr

Convert all relative URLs according to a <base> in HTML

resolve_base( $body) 
static

Arguments

$body

Main function, give it untrusted HTML, tell it if you allow loading remote images and give it a map to convert "cid:" urls.

wash( $html) 

Arguments

$html

Take a node and return allowed attributes and check values

wash_attribs( $node) 

Arguments

$node

Check CSS style

wash_style( $style) 

Arguments

$style

Wash URI value

wash_uri( $uri,  $blocked_source = false) 

Arguments

$uri

$blocked_source

Properties

html_elements

html_elements : 
static

Type(s)

ignore_elements

ignore_elements : 
static

Type(s)

html_attribs

html_attribs : 
static

Type(s)

void_elements

void_elements : 
static

Type(s)

config

config : 

Type(s)

handlers

handlers : 

Type(s)

_html_elements

_html_elements : 

Type(s)

_ignore_elements

_ignore_elements : 

Type(s)

_void_elements

_void_elements : 

Type(s)

_html_attribs

_html_attribs : 

Type(s)

max_nesting_level

max_nesting_level : 

Type(s)

is_xml

is_xml : 

Type(s)