Textarea.php 599 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Sets height/width defaults for <textarea>
  4. */
  5. class HTMLPurifier_AttrTransform_Textarea 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. // Calculated from Firefox
  16. if (!isset($attr['cols'])) {
  17. $attr['cols'] = '22';
  18. }
  19. if (!isset($attr['rows'])) {
  20. $attr['rows'] = '3';
  21. }
  22. return $attr;
  23. }
  24. }
  25. // vim: et sw=4 sts=4