ZF-7709: Zend_Application_Bootstrap_BootstrapAbstract::setOptions() merges Options but no $_optionKeys

Issue Type: Bug Created: 2009-08-28T03:27:28.000+0000 Last Updated: 2009-08-28T04:25:48.000+0000 Status: Resolved Fix version(s): - 1.9.3 (22/Sep/09)

Reporter: Benjamin (mr_jingles) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application

Related issues: Attachments:


h3. Behavior: Zend_Application_Bootstrap_BootstrapAbstract::setOptions() merges given options but not its keys.

h3. Effect: If options are set multiple times, only keys of the last options-set are registered. Later calls of Zend_Application_Bootstrap_BootstrapAbstract::hasOption() will fail for overwritten keys.

<pre class="highlight"> 
public function setOptions(array $options)
        $this->_options = $this->mergeOptions($this->_options, $options);

        $options = array_change_key_case($options, CASE_LOWER);
        $this->_optionKeys = array_keys($options);

h3. Suggested solution: Replace

<pre class="highlight"> $this->_optionKeys = array_keys($options);


<pre class="highlight"> $this->_optionKeys = array_merge($this->_optionKeys, array_keys($options));


Posted by Matthew Weier O'Phinney (matthew) on 2009-08-28T04:25:40.000+0000

This duplicates ZF-7690, which is already resolved in trunk and the 1.9 release branch; fixes will be released with 1.9.3.

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.