Composite.php 506 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Composite strategy that runs multiple strategies on tokens.
  4. */
  5. abstract class HTMLPurifier_Strategy_Composite extends HTMLPurifier_Strategy
  6. {
  7. /**
  8. * List of strategies to run tokens through.
  9. */
  10. protected $strategies = array();
  11. public function execute($tokens, $config, $context) {
  12. foreach ($this->strategies as $strategy) {
  13. $tokens = $strategy->execute($tokens, $config, $context);
  14. }
  15. return $tokens;
  16. }
  17. }
  18. // vim: et sw=4 sts=4