Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.6

Request #4055 Patch for Validate::multiple() and CreditCard::number()
Submitted: 2005-04-04 17:30 UTC
From: roehr at zilleon dot com Assigned: dufuz
Status: Closed Package: Validate
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 34 - 11 = ?

 
 [2005-04-04 17:30 UTC] roehr at zilleon dot com
Description: ------------ Hi, I have created the following patches: [1] Validate::multiple() http://www.zilleon.de/PEAR/Validate/Validate.diff.txt http://www.zilleon.de/PEAR/Validate/Validate.php.txt This patch changes the resolving of the class/method name when using one of Validate's subpackages. Until now only the first two elements (e.g. us_ssn) were recognized. This made it impossible to use the CreditCard or IBAN classes because their call consists of three parts: Finance_CreditCard_number Finance_IBAN_validate Now the last part is used as the method name and the rest makes up the class name. To use the CreditCard package within multiple you need to declare: 'type' => 'Finance_CreditCard_number' Because I have only removed a limitation, BC should be guaranteed. [2] Validate_Finance_CreditCard::number() http://www.zilleon.de/PEAR/Validate/Finance/CreditCard.diff.txt When calling this method via Validate::multiple() the options parameter $opt is passed to Validate_Finance_CreditCard::number() as an array. Because number() is checking for !is_null() it will always process this part of the method and thereby always return false. The patch changes the check to is_string(). [3] UnitTest for Validate::multiple() http://www.zilleon.de/PEAR/Validate/tests/multiple.php.txt Thanks for having a look at this! Best regards, Torsten Roehr

Comments

 [2005-04-04 17:47 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-04-04 18:21 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!