Re: [fw-general] Zend_Validate::is() runs constructor with wrong parameters

2009-09-08 Thread Thomas Weidner
I just wonder how the Int validator should check if a value is between 
something as it just checks if a given value is a integer or not. Shouldn't 
in your case Zend_Validate_Between be used ?


For Zend_Validate_Int the question is where the 1 comes from. As you did 
not provide an example how you called Zend_Validate::is() we can only guess.


Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com


- Original Message - 
From: Dennis Becker mail.dennisbec...@gmail.com

To: Zend Framework General fw-general@lists.zend.com
Sent: Tuesday, September 08, 2009 3:03 PM
Subject: [fw-general] Zend_Validate::is() runs constructor with wrong 
parameters



II have recently switched ZF Version from 1.7.4 to ZF 1.9.2 and I ran into 
a
problem with Zend_Validate::is() and Zend_Validate_Int. A variable should 
be

checked if it is an integer and between 1 and 31 - nothing special so far.
But Zend_Validate calls Zend_Validate_Int with 1 as parameter for the
constructor - which self tries to find a locale with
Zend_Locale::findLocale('1') - and then throws an exception. I know that
this worked without any problem with 1.7.4
On the SVN repository, I can see that with ZF Version 1.8.0 a constructor
was added to Zend_Validate_Int. Can anybody confirm this? I have opened a
bug report at http://framework.zend.com/issues/browse/ZF-7800

Also compare these files:

http://framework.zend.com/svn/framework/standard/tags/release-1.7.5/library/Zend/Validate/Int.php
http://framework.zend.com/svn/framework/standard/tags/release-1.8.0/library/Zend/Validate/Int.php


Has anybody a workaround for this? Or is it just a wrong behaviour in
Zend_Validate::is() static method?


Regards,
Dennis





[fw-general] Zend_Validate::is() runs constructor with wrong parameters

2009-09-08 Thread Dennis Becker
II have recently switched ZF Version from 1.7.4 to ZF 1.9.2 and I ran into a
problem with Zend_Validate::is() and Zend_Validate_Int. A variable should be
checked if it is an integer and between 1 and 31 - nothing special so far.
But Zend_Validate calls Zend_Validate_Int with 1 as parameter for the
constructor - which self tries to find a locale with
Zend_Locale::findLocale('1') - and then throws an exception. I know that
this worked without any problem with 1.7.4
On the SVN repository, I can see that with ZF Version 1.8.0 a constructor
was added to Zend_Validate_Int. Can anybody confirm this? I have opened a
bug report at http://framework.zend.com/issues/browse/ZF-7800

Also compare these files:

http://framework.zend.com/svn/framework/standard/tags/release-1.7.5/library/Zend/Validate/Int.php
http://framework.zend.com/svn/framework/standard/tags/release-1.8.0/library/Zend/Validate/Int.php


Has anybody a workaround for this? Or is it just a wrong behaviour in
Zend_Validate::is() static method?


Regards,
Dennis