Zend Framework

Zend_Validate_NotEmpty compatibility

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.0, 1.9.1
  • Fix Version/s: 1.9.2
  • Component/s: Zend_Validate
  • Labels:
    None

Description

Zend_Validate_NotEmpty doesn't accept anything else then string, int, float, bool but it was. Now object, arrays, etc are returnd as "empty"

Issue Links

Activity

Hide
Thomas Weidner added a comment -

No they're not.
You should look which sort of failure is returned.

In the above case you get "Invalid type given, value should be float, string, or integer".

I agree that Arrays are missing.
But a object can never be empty.
To check a object for emptyness is quite useless and in my eyes a failure.
Same for ressources.

Show
Thomas Weidner added a comment - No they're not. You should look which sort of failure is returned. In the above case you get "Invalid type given, value should be float, string, or integer". I agree that Arrays are missing. But a object can never be empty. To check a object for emptyness is quite useless and in my eyes a failure. Same for ressources.
Hide
Edi Skraba added a comment -

About objects:

What if i have such code:

{{$value = ($_POST['value']) ? new Zend_Date($_POST['value']) : null;}}

And im checking:
Zend_Validate::is($value,'NotEmpty')

I know that i can make a different solution but - as above - i don't know what's the type of $value - i just wan't to check if it's "NotEmpty".

As You said the objects are never empty so it could bo something like:
if(is_object($value)) return true;

Show
Edi Skraba added a comment - About objects: What if i have such code: {{$value = ($_POST['value']) ? new Zend_Date($_POST['value']) : null;}} And im checking: Zend_Validate::is($value,'NotEmpty') I know that i can make a different solution but - as above - i don't know what's the type of $value - i just wan't to check if it's "NotEmpty". As You said the objects are never empty so it could bo something like: if(is_object($value)) return true;
Hide
Thomas Weidner added a comment -

Fixed...

Allowed arrays. Objects and Ressources are disallowed.

Show
Thomas Weidner added a comment - Fixed... Allowed arrays. Objects and Ressources are disallowed.
Hide
Thomas Baumann added a comment -

Please see ZF-9968

Show
Thomas Baumann added a comment - Please see ZF-9968

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: