Issues

ZF-8938: Zend_Form does not return correct values with subforms named '0'

Description

Zend_Form::setName() allows subforms to be named '0' and even explicitly checks them with (empty() || === '0'). Zend_Form::getElementsBelongTo() uses getName() with empty() but does not check if name === '0'.

The result is data corruption in Zend_Form::getValues() because it uses getElementsBelongTo() for all subForms.

Comments

Fix, including unit test.

Adding additional patch which fixes error scrambling in forms with all-numeric names.

This patch is a Conclusion of the both patches but uses lesser function calls, no Unit Test included.

Fixed in [ZF-9401]

Reopened because suggested fix is not reviewed and committed yet.

Fixed in parent ZF-9401