2006-07-29 17:38:28 +00:00
|
|
|
<?php
|
|
|
|
|
2006-08-20 21:59:41 +00:00
|
|
|
/**
|
|
|
|
* Composite strategy that runs multiple strategies on tokens.
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy
|
2006-07-29 17:38:28 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-20 21:59:41 +00:00
|
|
|
/**
|
|
|
|
* List of strategies to run tokens through.
|
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
protected $strategies = array();
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
abstract public function __construct();
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2008-01-05 00:10:43 +00:00
|
|
|
public 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;
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-07-29 17:38:28 +00:00
|
|
|
}
|
|
|
|
|