Zend Framework

getOption not working with options that contains upper case characteres

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.10.6
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Application
  • Labels:
    None

Description

This issue occurs when you have a key with upper case characteres like appOptions, and you try to use $this->getOption('appOptions') inside the Bootstrap.

It seems to be related to a missing strtolower on the method hasOption of the class Zend_Application_Bootstrap_BootstrapAbstract.

As so, I think the method hasOption should be changed to include return in_array(strtolower($key), $this->_optionKeys); this way the getOption method will behave the same way on both Zend_Application_Bootstrap_BootstrapAbstract and Zend_Application, as expected.

This issue seams related to ZF-7742, where the same fix has been applied Zend_Application for solving a similar issue (and should have been applied also to Zend_Application_Bootstrap_BootstrapAbstract

As far as I know this affects all releases of ZF.

A simple workaround is to override the hasOption method when extending Zend_Application_Bootstrap_Bootstrap.

Issue Links

Activity

Hide
Ricardo Melo added a comment -

Sorry, It's fixed on the 1.10.7, and in the svn. My mistake

Show
Ricardo Melo added a comment - Sorry, It's fixed on the 1.10.7, and in the svn. My mistake
Hide
Ramon Henrique Ornelas added a comment -

Fixed in the version 1.10.7 in the issue ZF-10199.

Thanks by your report.

Show
Ramon Henrique Ornelas added a comment - Fixed in the version 1.10.7 in the issue ZF-10199. Thanks by your report.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: