Zend Framework

Usage of an uninitialized array in Zend_Console_Getopt

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.8.2
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Console_Getopt
  • Labels:
    None

Description

In Zend/Console/Getopt.php line 611 :

$lines[] = $linepart;

$lines has not been initialized as an empty array before the foreach loop.
So, if $this->_rules is empty, the foreach never loops, $lines remain undefined, and a warning is sent at line 613 :

foreach ($lines as $linepart) {

I guess a simple :

$lines = array();

at line 585 should resolve the issue.

Issue Links

Activity

Hide
Ramon Henrique Ornelas added a comment -

Merged to branch release-1.10 r22495.

Show
Ramon Henrique Ornelas added a comment - Merged to branch release-1.10 r22495.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: