ZF-6898: Usage of an uninitialized array in Zend_Console_Getopt

Issue Type: Bug Created: 2009-06-03T16:53:11.000+0000 Last Updated: 2010-07-02T17:36:24.000+0000 Status: Resolved Fix version(s): - 1.10.7 (28/Jul/10)

Reporter: nerVo (nervo) Assignee: Ramon Henrique Ornelas (ramon) Tags: - Zend_Console_Getopt

Related issues: - ZF-9756



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.


Posted by Ramon Henrique Ornelas (ramon) on 2010-07-02T17:35:12.000+0000

Merged to branch release-1.10 r22495.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.