2006-07-29 17:38:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/Strategy.php';
|
2006-08-04 01:47:48 +00:00
|
|
|
require_once 'HTMLPurifier/Config.php';
|
2006-07-29 17:38:28 +00:00
|
|
|
|
2006-08-20 21:59:41 +00:00
|
|
|
/**
|
|
|
|
* Composite strategy that runs multiple strategies on tokens.
|
|
|
|
*/
|
2006-08-28 20:29:36 +00:00
|
|
|
class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy
|
2006-07-29 17:38:28 +00:00
|
|
|
{
|
|
|
|
|
2006-08-20 21:59:41 +00:00
|
|
|
/**
|
|
|
|
* List of strategies to run tokens through.
|
|
|
|
*/
|
2006-07-29 17:38:28 +00:00
|
|
|
var $strategies = array();
|
|
|
|
|
|
|
|
function HTMLPurifier_Strategy_Composite() {
|
|
|
|
trigger_error('Attempt to instantiate abstract object', E_USER_ERROR);
|
|
|
|
}
|
|
|
|
|
2006-10-01 20:47:07 +00:00
|
|
|
function execute($tokens, $config, &$context) {
|
2006-07-29 17:38:28 +00:00
|
|
|
foreach ($this->strategies as $strategy) {
|
2006-10-01 20:47:07 +00:00
|
|
|
$tokens = $strategy->execute($tokens, $config, $context);
|
2006-07-29 17:38:28 +00:00
|
|
|
}
|
|
|
|
return $tokens;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|