LibFilter
in package
LibFilter
A PHP HTML filtering library
http://iamcal.com/publish/articles/php/processing_html/ http://iamcal.com/publish/articles/php/processing_html_part_2/
By Cal Henderson cal@iamcal.com This code is licensed under a Creative Commons Attribution-ShareAlike 2.5 License http://creativecommons.org/licenses/by-sa/2.5/
Thanks to Jang Kim for adding support for single quoted attributes Thanks to Dan Bogan for dealing with entity decoding outside attributes
Tags
Table of Contents
Properties
- $allow_numbered_entities : mixed
- $allowed : mixed
- $allowed_entities : mixed
- $allowed_protocols : mixed
- $always_close : mixed
- $always_make_tags : mixed
- $no_close : mixed
- $normalise_ascii_entities : mixed
- $protocol_attributes : mixed
- $remove_blanks : mixed
- $strip_comments : mixed
- $tag_counts : mixed
Methods
- balance_html() : mixed
- check_entity() : mixed
- check_tags() : mixed
- cleanup_non_tags() : mixed
- cleanup_non_tags_inner() : mixed
- decode_dec_entity() : mixed
- decode_entities() : mixed
- decode_hex_entity() : mixed
- decode_num_entity() : mixed
- escape_comments() : mixed
- fix_case() : mixed
- fix_case_inner() : mixed
- go() : mixed
- is_valid_entity() : mixed
- process_param_protocol() : mixed
- process_remove_blanks() : mixed
- process_tag() : mixed
- StripSingle() : mixed
- validate_entities() : mixed
Properties
$allow_numbered_entities
public
mixed
$allow_numbered_entities
= 1
$allowed
public
mixed
$allowed
= array('a' => array('href', 'target'), 'b' => array(), 'img' => array('src', 'width', 'height', 'alt'))
$allowed_entities
public
mixed
$allowed_entities
= array('amp', 'gt', 'lt', 'quot')
$allowed_protocols
public
mixed
$allowed_protocols
= array('http', 'https', 'ftp', 'mailto')
$always_close
public
mixed
$always_close
= array('a', 'b')
$always_make_tags
public
mixed
$always_make_tags
= 1
$no_close
public
mixed
$no_close
= array('img')
$normalise_ascii_entities
public
mixed
$normalise_ascii_entities
= 0
$protocol_attributes
public
mixed
$protocol_attributes
= array('src', 'href')
$remove_blanks
public
mixed
$remove_blanks
= array('a', 'b')
$strip_comments
public
mixed
$strip_comments
= 1
$tag_counts
public
mixed
$tag_counts
= array()
Methods
balance_html()
public
balance_html(mixed $data) : mixed
Parameters
- $data : mixed
check_entity()
public
check_entity(mixed $preamble, mixed $term) : mixed
Parameters
- $preamble : mixed
- $term : mixed
check_tags()
public
check_tags(mixed $data) : mixed
Parameters
- $data : mixed
cleanup_non_tags()
public
cleanup_non_tags(mixed $data) : mixed
Parameters
- $data : mixed
cleanup_non_tags_inner()
public
cleanup_non_tags_inner(mixed $m) : mixed
Parameters
- $m : mixed
decode_dec_entity()
public
decode_dec_entity(mixed $m) : mixed
Parameters
- $m : mixed
decode_entities()
public
decode_entities(mixed $data[, mixed $in_attribute = 1 ]) : mixed
Parameters
- $data : mixed
- $in_attribute : mixed = 1
decode_hex_entity()
public
decode_hex_entity(mixed $m) : mixed
Parameters
- $m : mixed
decode_num_entity()
public
decode_num_entity(mixed $orig_type, mixed $d) : mixed
Parameters
- $orig_type : mixed
- $d : mixed
escape_comments()
public
escape_comments(mixed $data) : mixed
Parameters
- $data : mixed
fix_case()
public
fix_case(mixed $data) : mixed
Parameters
- $data : mixed
fix_case_inner()
public
fix_case_inner(mixed $m) : mixed
Parameters
- $m : mixed
go()
public
go(mixed $data) : mixed
Parameters
- $data : mixed
is_valid_entity()
public
is_valid_entity(mixed $entity) : mixed
Parameters
- $entity : mixed
process_param_protocol()
public
process_param_protocol(mixed $data) : mixed
Parameters
- $data : mixed
process_remove_blanks()
public
process_remove_blanks(mixed $data) : mixed
Parameters
- $data : mixed
process_tag()
public
process_tag(mixed $data) : mixed
Parameters
- $data : mixed
StripSingle()
public
StripSingle(mixed $data) : mixed
Parameters
- $data : mixed
validate_entities()
public
validate_entities(mixed $data, mixed $in_attribute) : mixed
Parameters
- $data : mixed
- $in_attribute : mixed