Zend Framework

CLONE -value "0" is treated as empty

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.5.1
  • Fix Version/s: 1.5.3
  • Component/s: Zend_Validate
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

Code example:

Zend_Debug::dump(Zend_Validate::is('0', 'NotEmpty')); // false

As you see 0 (and '0') is treated as empty. Way to fix is replace Zend_Validate_NotEmpty:62:

if (empty($value)) {

with

if ('' === $value || null === $value) {

Issue Links

Activity

Hide
Matthew Weier O'Phinney added a comment -

Fix committed to trunk and 1.5 and 1.6 release branches.

Show
Matthew Weier O'Phinney added a comment - Fix committed to trunk and 1.5 and 1.6 release branches.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified