Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.10.0
-
Fix Version/s: 1.10.5
-
Component/s: Zend_Filter
-
Labels:None
Description
Zend_Filter_StripTags changed it behavior
from:
public function __construct($tagsAllowed = null, $attributesAllowed = null, $commentsAllowed = false)
to:
public function __construct($options = null)
{
if ($options instanceof Zend_Config) {
$options = $options->toArray();
} else if (!is_array($options)) {
$options = func_get_args();
$temp['allowTags'] = array_shift($options);
if (!empty($options)) {
$temp['allowAttribs'] = array_shift($options);
}
if (!empty($options)) { $temp['allowComments'] = array_shift($options); }
$options = $temp;
}
if (array_key_exists('allowTags', $options)) { $this->setTagsAllowed($options['allowTags']); }
if (array_key_exists('allowAttribs', $options)) { $this->setAttributesAllowed($options['allowAttribs']); }
if (array_key_exists('allowComments', $options)) {
$this->setCommentsAllowed($options['allowComments']);
}
}
The filter is not downwardly compatible to the old filter this "} else if (!is_array($options)) {" will not handle the old style implementation
e.g.
new Zend_Filter_StripTags(array("a","b","hr"),array(),true)
Will always filter all tags!!!!
Implemented with r22170