include/clean.php
\HTMLPurifier_Filter_Xmp
Represents a pre or post processing filter on HTML Purifier's output
Sometimes, a little ad-hoc fixing of HTML has to be done before it gets sent through HTML Purifier: you can use filters to acheive this effect. For instance, YouTube videos can be preserved using this manner. You could have used a decorator for this task, but PHP's support for them is not terribly robust, so we're going to just loop through the filters.
Filters should be exited first in, last out. If there are three filters, named 1, 2 and 3, the order of execution should go 1->preFilter, 2->preFilter, 3->preFilter, purify, 3->postFilter, 2->postFilter, 1->postFilter.
- Parent(s)
- \HTMLPurifier_Filter
Properties
Methods
postFilter(
$html, $config, $context
)
:
void
Post-processor function, handles HTML after HTML Purifier
Inherited from: \HTMLPurifier_Filter::postFilter()Name | Type | Description |
---|---|---|
$html | ||
$config | ||
$context |
\HTMLPurifier_URIScheme_cid
cid: scheme implementation
- Parent(s)
- \HTMLPurifier_URIScheme
Properties
$browsable= 'true'
Whether or not URIs of this schem are locatable by a browser http and ftp are accessible, while mailto and news are not.
true
Details- Type
- n/a
$default_port= 'null'
Scheme's default port (integer). If an explicit port number is specified that coincides with the default port, it will be elided.
Inherited from: \HTMLPurifier_URIScheme::$$default_portnull
Details- Type
- n/a
- Inherited_from
- \HTMLPurifier_URIScheme::$$default_port
$hierarchical= 'false'
Whether or not the URI always uses <hier_part>, resolves edge cases with making relative URIs absolute
Inherited from: \HTMLPurifier_URIScheme::$$hierarchicalfalse
Details- Type
- n/a
- Inherited_from
- \HTMLPurifier_URIScheme::$$hierarchical
Methods
doValidate(
\$uri $uri, \$config $config, \$context $context
)
:
Bool
Validates the components of a URI for a specific scheme.
Name | Type | Description |
---|---|---|
$uri | \$uri | Reference to a HTMLPurifier_URI object |
$config | \$config | HTMLPurifier_Config object |
$context | \$context | HTMLPurifier_Context object |
Type | Description |
---|---|
Bool | success or failure |
validate(
\$uri $uri, \$config $config, \$context $context
)
:
Bool
Public interface for validating components of a URI. Performs a bunch of default actions. Don't overload this method.
Inherited from: \HTMLPurifier_URIScheme::validate()Name | Type | Description |
---|---|---|
$uri | \$uri | Reference to a HTMLPurifier_URI object |
$config | \$config | HTMLPurifier_Config object |
$context | \$context | HTMLPurifier_Context object |
Type | Description |
---|---|
Bool | success or failure |
\SugarCleaner
Properties
Methods
\SugarURIFilter
URI filter for HTMLPurifier Approves only resource URIs that are in the list of trusted domains Until we have comprehensive CSRF protection, we need to sanitize URLs in emails, etc.
to avoid CSRF attacks.
- Parent(s)
- \HTMLPurifier_URIFilter
Properties
$post= 'false'
True if this filter should be run after scheme validation.
Inherited from: \HTMLPurifier_URIFilter::$$postfalse
Details- Type
- n/a
- Inherited_from
- \HTMLPurifier_URIFilter::$$post
Methods
filter(
\$uri $uri, \$config $config, \$context $context
)
:
bool
Filter a URI object
Name | Type | Description |
---|---|---|
$uri | \$uri | Reference to URI object variable |
$config | \$config | Instance of HTMLPurifier_Config |
$context | \$context | Instance of HTMLPurifier_Context |
Type | Description |
---|---|
bool | Whether or not to continue processing: false indicates URL is no good, true indicates continue processing. Note that all changes are committed directly on the URI object |