Pluf_Text_HTML_Filter Class Reference

List of all members.

Public Member Functions

 go ($data)
 escape_comments ($data)
 balance_html ($data)
 check_tags ($data)
 process_tag ($data)
 process_param_protocol ($data)
 process_remove_blanks ($data)
 fix_case ($data)
 fix_case_inner ($data)
 validate_entities ($data)
 check_entity ($preamble, $term)
 is_valid_entity ($entity)
 not_control_caracter ($data)
 decode_entities ($data)
 decode_hex_entity ($m)
 decode_dec_entity ($m)
 decode_num_entity ($orig_type, $d)
 StripSingle ($data)

Public Attributes

 $tag_counts = array()
 $allowed
 $no_close
 $always_close
 $protocol_attributes
 $allowed_protocols
 $remove_blanks
 $strip_comments = 1
 $always_make_tags = 0
 $allow_numbered_entities = 1
 $allow_hexadecimal_entities = 1
 $allowed_entities


Detailed Description

A PHP HTML filtering library

lib_filter.php,v 1.15 2006/09/28 22:44:31 cal

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.

TODO: Add HTML check from: http://simonwillison.net/2003/Feb/23/safeHtmlChecker/


Member Function Documentation

Pluf_Text_HTML_Filter::go ( data  ) 

Pluf_Text_HTML_Filter::escape_comments ( data  ) 

Pluf_Text_HTML_Filter::balance_html ( data  ) 

Pluf_Text_HTML_Filter::check_tags ( data  ) 

Pluf_Text_HTML_Filter::process_tag ( data  ) 

Pluf_Text_HTML_Filter::process_param_protocol ( data  ) 

Pluf_Text_HTML_Filter::process_remove_blanks ( data  ) 

Pluf_Text_HTML_Filter::fix_case ( data  ) 

Pluf_Text_HTML_Filter::fix_case_inner ( data  ) 

Pluf_Text_HTML_Filter::validate_entities ( data  ) 

Pluf_Text_HTML_Filter::check_entity ( preamble,
term 
)

Pluf_Text_HTML_Filter::is_valid_entity ( entity  ) 

Determines if the string provided is a valid entity.

Parameters:
string $entity String to test against.
Returns:
boolean

Pluf_Text_HTML_Filter::not_control_caracter ( data  ) 

Determines if the data provided is not a control character.

Parameters:
string|int $data Data to test against like "64" or "x40".
Returns:
boolean

Pluf_Text_HTML_Filter::decode_entities ( data  ) 

Pluf_Text_HTML_Filter::decode_hex_entity ( m  ) 

Pluf_Text_HTML_Filter::decode_dec_entity ( m  ) 

Pluf_Text_HTML_Filter::decode_num_entity ( orig_type,
d 
)

Pluf_Text_HTML_Filter::StripSingle ( data  ) 


Member Data Documentation

Pluf_Text_HTML_Filter::$tag_counts = array()

Pluf_Text_HTML_Filter::$allowed

Initial value:

 array(
                            'a' => array('href', 'target'),
                            'b' => array(),
                            'img' => array('src', 'width', 'height', 'alt'),
                            )
tags and attributes that are allowed

Pluf_Text_HTML_Filter::$no_close

Initial value:

 array(
                             'img',
                             )
tags which should always be self-closing (e.g. "<img />")

Pluf_Text_HTML_Filter::$always_close

Initial value:

 array(
                                 'a',
                                 'b',
                                 )
tags which must always have seperate opening and closing tags (e.g. "<b></b>")

Pluf_Text_HTML_Filter::$protocol_attributes

Initial value:

 array(
                                        'src',
                                        'href',
                                        )
attributes which should be checked for valid protocols

Pluf_Text_HTML_Filter::$allowed_protocols

Initial value:

 array(
                                      'http',
                                      'ftp',
                                      'mailto',
                                      )
protocols which are allowed

Pluf_Text_HTML_Filter::$remove_blanks

Initial value:

 array(
                                  'a',
                                  'b',
                                  )
tags which should be removed if they contain no content (e.g. "<b></b>" or "<b />")

Pluf_Text_HTML_Filter::$strip_comments = 1

should we remove comments?

Pluf_Text_HTML_Filter::$always_make_tags = 0

should we try and make a b tag out of "b>"

Pluf_Text_HTML_Filter::$allow_numbered_entities = 1

Pluf_Text_HTML_Filter::$allow_hexadecimal_entities = 1

Pluf_Text_HTML_Filter::$allowed_entities

Initial value:

 array(
                                     'amp',
                                     'gt',
                                     'lt',
                                     'quot',
                                     )


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen