Zend Framework

Zend_Application_Bootstrap_BootstrapAbstract::setOptions() merges Options but no $_optionKeys

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.9.2
  • Fix Version/s: 1.9.3
  • Component/s: Zend_Application
  • Labels:
    None

Description

Behavior:

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

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);
        ....

Suggested solution:

Replace

$this->_optionKeys = array_keys($options);

with

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

Activity

Hide
Matthew Weier O'Phinney added a comment -

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

Show
Matthew Weier O'Phinney added a comment - This duplicates ZF-7690, which is already resolved in trunk and the 1.9 release branch; fixes will be released with 1.9.3.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: