ZF-7709: Zend_Application_Bootstrap_BootstrapAbstract::setOptions() merges Options but no $_optionKeys
Description
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.
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
$this->_optionKeys = array_keys($options);
with
$this->_optionKeys = array_merge($this->_optionKeys, array_keys($options));
Comments
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.