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

Check CSS style

wash_style($style) 

Arguments

$style

Take a node and return allowed attributes and check values

wash_attribs($node) 

Arguments

$node

The main loop that recurse on a node tree.

dumpHtml($node, $level) 

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

Arguments

$node

$level

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

Getter for config parameters

get_config($prop) 

Arguments

$prop

Clean HTML input

cleanup($html) 

Arguments

$html

Callback function for HTML tags fixing

html_tag_callback($matches) 
static

Arguments

$matches

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

resolve_base($body) 
static

Arguments

$body

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

fix_broken_lists(&$html) 
static

Arguments

$html

Properties

html_elements

html_elements : 
static

ignore_elements

ignore_elements : 
static

html_attribs

html_attribs : 
static

void_elements

void_elements : 
static

config

config : 

handlers

handlers : 

_html_elements

_html_elements : 

_ignore_elements

_ignore_elements : 

_void_elements

_void_elements : 

_html_attribs

_html_attribs : 

max_nesting_level

max_nesting_level :