Textarea.php 599 B

12345678910111213141516171819202122232425262728
  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