2006-07-23 23:23:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Supertype for classes that define a strategy for modifying/purifying tokens.
|
|
|
|
*
|
|
|
|
* While HTMLPurifier's core purpose is fixing HTML into something proper,
|
|
|
|
* strategies provide plug points for extra configuration or even extra
|
|
|
|
* features, such as custom tags, custom parsing of text, etc.
|
|
|
|
*/
|
|
|
|
|
2006-09-16 22:36:58 +00:00
|
|
|
HTMLPurifier_ConfigSchema::define(
|
2006-08-27 18:49:16 +00:00
|
|
|
'Core', 'EscapeInvalidTags', false, 'bool',
|
2006-08-15 23:58:18 +00:00
|
|
|
'When true, invalid tags will be written back to the document as plain '.
|
|
|
|
'text. Otherwise, they are silently dropped.'
|
|
|
|
);
|
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
abstract class HTMLPurifier_Strategy
|
2006-07-23 23:23:14 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Executes the strategy on the tokens.
|
|
|
|
*
|
|
|
|
* @param $tokens Array of HTMLPurifier_Token objects to be operated on.
|
2006-08-04 01:47:48 +00:00
|
|
|
* @param $config Configuration options
|
2006-07-23 23:23:14 +00:00
|
|
|
* @returns Processed array of token objects.
|
|
|
|
*/
|
2008-01-05 00:10:43 +00:00
|
|
|
abstract public function execute($tokens, $config, $context);
|
2006-07-23 23:23:14 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|