ZF-7695: Wrong __construct parse for giving arguments

Issue Type: Bug Created: 2009-08-26T15:24:38.000+0000 Last Updated: 2009-08-27T12:20:46.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Oleg Demeshev (01eg) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments:


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


Posted by Thomas Weidner (thomas) on 2009-08-27T12:20:45.000+0000

Fixed with r17848

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.