MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / lib / htmlpurifier / HTMLPurifier / Filter.php
blob99cdeebaaecffdaf8785c79cb1c2931969818d73
1 <?php
3 /**
4 * Represents a pre or post processing filter on HTML Purifier's output
5 *
6 * Sometimes, a little ad-hoc fixing of HTML has to be done before
7 * it gets sent through HTML Purifier: you can use filters to acheive
8 * this effect. For instance, YouTube videos can be preserved using
9 * this manner. You could have used a decorator for this task, but
10 * PHP's support for them is not terribly robust, so we're going
11 * to just loop through the filters.
13 * Filters should be exited first in, last out. If there are three filters,
14 * named 1, 2 and 3, the order of execution should go 1->preFilter,
15 * 2->preFilter, 3->preFilter, purify, 3->postFilter, 2->postFilter,
16 * 1->postFilter.
19 class HTMLPurifier_Filter
22 /**
23 * Name of the filter for identification purposes
25 var $name;
27 /**
28 * Pre-processor function, handles HTML before HTML Purifier
30 function preFilter($html, $config, &$context) {}
32 /**
33 * Post-processor function, handles HTML after HTML Purifier
35 function postFilter($html, $config, &$context) {}