Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.10.6
-
Fix Version/s: 1.10.7
-
Component/s: Zend_Application
-
Labels:None
Description
public function getOption($key) { if ($this->hasOption($key)) { $options = $this->getOptions(); $options = array_change_key_case($options, CASE_LOWER); return $options[strtolower($key)]; } return null; }
hasOption() is case sensitve so it never gets to the strtolowerpart
2 possible solutions:
make getOption() like this:
public function getOption($key) { $key = strtolower($key); if ($this->hasOption($key)) { $options = $this->getOptions(); $options = array_change_key_case($options, CASE_LOWER); return $options[$key]; } return null; }
Or make hasOption, since all options get loaded into lowercase keys anyway:
public function hasOption($key) { return in_array(strtolower($key), $this->_optionKeys); }
How can this be resolved if it is still not fixed in 1.10.6? :S Please take a look into this and write a test or something so it won't appear again