You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 line
516B

  1. <?php
  2. /**
  3. * Implements required attribute stipulation for <script>
  4. */
  5. class HTMLPurifier_AttrTransform_ScriptRequired extends HTMLPurifier_AttrTransform
  6. {
  7. /**
  8. * @param array $attr
  9. * @param HTMLPurifier_Config $config
  10. * @param HTMLPurifier_Context $context
  11. * @return array
  12. */
  13. public function transform($attr, $config, $context)
  14. {
  15. if (!isset($attr['type'])) {
  16. $attr['type'] = 'text/javascript';
  17. }
  18. return $attr;
  19. }
  20. }
  21. // vim: et sw=4 sts=4