BdoDir.php 463 B

12345678910111213141516171819
  1. <?php
  2. // this MUST be placed in post, as it assumes that any value in dir is valid
  3. /**
  4. * Post-trasnform that ensures that bdo tags have the dir attribute set.
  5. */
  6. class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
  7. {
  8. public function transform($attr, $config, $context) {
  9. if (isset($attr['dir'])) return $attr;
  10. $attr['dir'] = $config->get('Attr.DefaultTextDir');
  11. return $attr;
  12. }
  13. }
  14. // vim: et sw=4 sts=4