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.'
|
|
|
|
);
|
|
|
|
|
2006-07-23 23:23:14 +00:00
|
|
|
class HTMLPurifier_Strategy
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2006-10-01 20:47:07 +00:00
|
|
|
function execute($tokens, $config, &$context) {
|
2006-07-23 23:23:14 +00:00
|
|
|
trigger_error('Cannot call abstract function', E_USER_ERROR);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|