include/phpmailer/extras/htmlfilter.php

Show: inherited
    Table of Contents

    Functions

    functionHTMLFilter(  $body,  $trans_image_path,  $block_external_images = false ) : void

    Parameters
    Name Type Description
    $body
    $trans_image_path
    $block_external_images
    functiontln_casenormalize( \$val $val ) : void

    A small helper function to use with array_walk. Modifies a by-ref value and makes it lowercase.

    Parameters
    Name Type Description
    $val \$val

    a value passed by-ref.

    functiontln_deent( \$attvalue $attvalue, \$regex $regex, \$hex $hex = false ) : True

    Translates entities into literal values so they can be checked.

    Parameters
    Name Type Description
    $attvalue \$attvalue

    the by-ref value to check.

    $regex \$regex

    the regular expression to check against.

    $hex \$hex

    whether the entites are hexadecimal.

    Returns
    Type Description
    True or False depending on whether there were matches.
    functiontln_defang( \$attvalue $attvalue ) : \Nothing,

    This function checks attribute values for entity-encoded values and returns them translated into 8-bit strings so we can run checks on them.

    Parameters
    Name Type Description
    $attvalue \$attvalue

    A string to run entity check against.

    Returns
    Type Description
    \Nothing, modifies a reference value.
    functiontln_findnxreg( \$body $body, \$offset $offset, \$reg $reg ) : \Returns

    This function takes a PCRE-style regexp and tries to match it within the string.

    Parameters
    Name Type Description
    $body \$body

    The string to look for needle in.

    $offset \$offset

    Start looking from here.

    $reg \$reg

    A PCRE-style regex to match.

    Returns
    Type Description
    \Returns a false if no matches found, or an array with the following members: - integer with the location of the match within $body - string with whatever content between offset and the match - string with whatever it is we matched
    functiontln_findnxstr( \$body $body, \$offset $offset, \$needle $needle ) : \location

    This function looks for the next character within a string. It's really just a glorified "strpos", except it catches the failures nicely.

    Parameters
    Name Type Description
    $body \$body

    The string to look for needle in.

    $offset \$offset

    Start looking from this position.

    $needle \$needle

    The character/string to look for.

    Returns
    Type Description
    \location of the next occurance of the needle, or strlen($body) if needle wasn't found.
    functiontln_fixatts( \$tagname $tagname, \$attary $attary, \$rm_attnames $rm_attnames, \$bad_attvals $bad_attvals, \$add_attr_to_tag $add_attr_to_tag ) : Array

    This function runs various checks against the attributes.

    Parameters
    Name Type Description
    $tagname \$tagname

    String with the name of the tag.

    $attary \$attary

    Array with all tag attributes.

    $rm_attnames \$rm_attnames

    See description for tln_sanitize

    $bad_attvals \$bad_attvals

    See description for tln_sanitize

    $add_attr_to_tag \$add_attr_to_tag

    See description for tln_sanitize

    Returns
    Type Description
    Array with modified attributes.
    functiontln_getnxtag( \$body $body, \$offset $offset ) : false

    This function looks for the next tag.

    Parameters
    Name Type Description
    $body \$body

    String where to look for the next tag.

    $offset \$offset

    Start looking from here.

    Returns
    Type Description
    false if no more tags exist in the body, or an array with the following members: - string with the name of the tag - array with attributes and their values - integer with tag type (1, 2, or 3) - integer where the tag starts (starting "<") - integer where the tag ends (ending ">") first three members will be false, if the tag is invalid.
    functiontln_sanitize( \$body $body, \$tag_list $tag_list, \$rm_tags_with_content $rm_tags_with_content, \$self_closing_tags $self_closing_tags, \$force_tag_closing $force_tag_closing, \$rm_attnames $rm_attnames, \$bad_attvals $bad_attvals, \$add_attr_to_tag $add_attr_to_tag ) : \tln_sanitized

    Parameters
    Name Type Description
    $body \$body

    the string with HTML you wish to filter

    $tag_list \$tag_list

    see description above

    $rm_tags_with_content \$rm_tags_with_content

    see description above

    $self_closing_tags \$self_closing_tags

    see description above

    $force_tag_closing \$force_tag_closing

    see description above

    $rm_attnames \$rm_attnames

    see description above

    $bad_attvals \$bad_attvals

    see description above

    $add_attr_to_tag \$add_attr_to_tag

    see description above

    Returns
    Type Description
    \tln_sanitized html safe to show on your pages.
    functiontln_skipspace( \$body $body, \$offset $offset ) : \the

    This function skips any whitespace from the current position within a string and to the next non-whitespace value.

    Parameters
    Name Type Description
    $body \$body

    the string

    $offset \$offset

    the offset within the string where we should start looking for the next non-whitespace character.

    Returns
    Type Description
    \the location within the $body where the next non-whitespace char is located.
    functiontln_tagprint( \$tagname $tagname, \$attary $attary, \$tagtype $tagtype ) : \a

    This function returns the final tag out of the tag name, an array of attributes, and the type of the tag. This function is called by tln_sanitize internally.

    Parameters
    Name Type Description
    $tagname \$tagname

    the name of the tag.

    $attary \$attary

    the array of attributes and their values

    $tagtype \$tagtype

    The type of the tag (see in comments).

    Returns
    Type Description
    \a string with the final tag representation.
    functiontln_unspace( \attvalue $attvalue ) : \attvalue

    Kill any tabs, newlines, or carriage returns. Our friends the makers of the browser with 95% market value decided that it'd be funny to make "java[tab]script" be just as good as "javascript".

    Parameters
    Name Type Description
    $attvalue \attvalue

    The attribute value before extraneous spaces removed.

    Returns
    Type Description
    \attvalue Nothing, modifies a reference value.
    Documentation was generated by DocBlox 0.18.1.