2008-08-15 22:57:44 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets height/width defaults for <textarea>
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_AttrTransform_Textarea extends HTMLPurifier_AttrTransform
|
|
|
|
{
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param array $attr
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @param HTMLPurifier_Context $context
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform($attr, $config, $context)
|
|
|
|
{
|
2008-08-15 22:57:44 +00:00
|
|
|
// Calculated from Firefox
|
2013-07-16 11:56:14 +00:00
|
|
|
if (!isset($attr['cols'])) {
|
|
|
|
$attr['cols'] = '22';
|
|
|
|
}
|
|
|
|
if (!isset($attr['rows'])) {
|
|
|
|
$attr['rows'] = '3';
|
|
|
|
}
|
2008-08-15 22:57:44 +00:00
|
|
|
return $attr;
|
|
|
|
}
|
2008-12-06 09:24:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|