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.
|
2013-07-16 11:56:14 +00:00
|
|
|
* @type HTMLPurifier_Strategy[]
|
2006-08-20 21:59:41 +00:00
|
|
|
*/
|
2007-11-25 02:24:39 +00:00
|
|
|
protected $strategies = array();
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param HTMLPurifier_Token[] $tokens
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @param HTMLPurifier_Context $context
|
|
|
|
* @return HTMLPurifier_Token[]
|
|
|
|
*/
|
|
|
|
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 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|