ZF-7695: Wrong __construct parse for giving arguments
Description
According to documnetation the Zend/Filter/HtmlEntities must be use in this way:
Zend_Filter::filterStatic('"', 'HtmlEntities', array(ENT_QUOTES, 'UTF-8'));
but the __construct method is checking the arguments with the key which are not described in the guide: public function __construct($options = array()) { ... if (!isset($options['quotestyle'])) { $options['quotestyle'] = ENT_COMPAT; }
if (!isset($options['charset'])) {
$options['charset'] = 'ISO-8859-1';
}
... }
Solution: - change the guide to Zend_Filter::filterStatic('"', 'HtmlEntities', array('quotestyle'=>ENT_QUOTES, 'charset'=>'UTF-8')); OR - change the __construct method to: public function __construct($options = array()) { ... if (!isset($options[0])) { $options[0] = ENT_COMPAT; }
if (!isset($options[1])) {
$options[1] = 'ISO-8859-1';
}
... }
Thank you
Kind regards Oleg Demeshev
Comments
Posted by Thomas Weidner (thomas) on 2009-08-27T12:20:45.000+0000
Fixed with r17848