4 * Chainable filters for custom URI processing.
6 * These filters can perform custom actions on a URI filter object,
7 * including transformation or blacklisting. A filter named Foo
8 * must have a corresponding configuration directive %URI.Foo,
9 * unless always_load is specified to be true.
11 * The following contexts may be available while URIFilters are being
14 * - EmbeddedURI: true if URI is an embedded resource that will
15 * be loaded automatically on page load
16 * - CurrentToken: a reference to the token that is currently
18 * - CurrentAttr: the name of the attribute that is currently being
20 * - CurrentCSSProperty: the name of the CSS property that is
21 * currently being processed (if applicable)
23 * @warning This filter is called before scheme object validation occurs.
24 * Make sure, if you require a specific scheme object, you
25 * you check that it exists. This allows filters to convert
26 * proprietary URI schemes into regular ones.
28 abstract class HTMLPurifier_URIFilter
32 * Unique identifier of filter.
38 * True if this filter should be run after scheme validation.
44 * True if this filter should always be loaded.
45 * This permits a filter to be named Foo without the corresponding
46 * %URI.Foo directive existing.
49 public $always_load = false;
52 * Performs initialization for the filter. If the filter returns
53 * false, this means that it shouldn't be considered active.
54 * @param HTMLPurifier_Config $config
57 public function prepare($config)
64 * @param HTMLPurifier_URI $uri Reference to URI object variable
65 * @param HTMLPurifier_Config $config
66 * @param HTMLPurifier_Context $context
67 * @return bool Whether or not to continue processing: false indicates
68 * URL is no good, true indicates continue processing. Note that
69 * all changes are committed directly on the URI object
71 abstract public function filter(&$uri, $config, $context);