101 trigger_error(
'HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom', E_USER_WARNING);
128 $context->register(
'Generator', $this->generator);
131 if (
$config->get(
'Core.CollectErrors')) {
135 $context->register(
'Locale', $language);
138 $context->register(
'ErrorCollector', $error_collector);
144 $context->register(
'IDAccumulator', $id_accumulator);
149 $filter_flags =
$config->getBatch(
'Filter');
150 $custom_filters = $filter_flags[
'Custom'];
151 unset($filter_flags[
'Custom']);
153 foreach ($filter_flags as
$filter => $flag) {
154 if (!$flag)
continue;
155 if (strpos(
$filter,
'.') !==
false)
continue;
156 $class =
"HTMLPurifier_Filter_$filter";
159 foreach ($custom_filters as
$filter) {
166 for ($i = 0, $filter_size = count(
$filters); $i < $filter_size; $i++) {
172 $this->generator->generateFromTokens(
174 $this->strategy->execute(
176 $lexer->tokenizeHTML(
184 for ($i = $filter_size - 1; $i >= 0; $i--) {
200 $context_array = array();
201 foreach ($array_of_html as
$key => $html) {
205 $this->context = $context_array;
206 return $array_of_html;
215 public static function instance($prototype = null) {
216 if (!self::$instance || $prototype) {
218 self::$instance = $prototype;