Reputation:
I am trying to strip all html tags except <p>,<br>,<strong>,<b>
from input data from the following:
public function init()
{
parent::init();
$this->fields = array(
'name' => 'Name',
'age' => 'Age',
'profile' => 'Profile',
);
$this->mdata = array();
$this->verify = true;
}
Anyone knows how to apply Zend_Filter_StripTags in it?
Upvotes: 4
Views: 4477
Reputation: 42093
If I understand your problem:
$allowedTags = array('p','b','br','strong'); // Allowed tags
$allowedAttributes = array('href'); // Allowed attributes
$stripTags = new Zend_Filter_StripTags($allowedTags,$allowedAttributes); // instance of zend filter
$sanitizedInput = $stripTags->filter($input); //$input is input html
Upvotes: 8