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

Bug #11712 checkMOD23 buggy. IE6572557W is a valid vat number.
Submitted: 2007-07-30 23:41 UTC
From: kguest Assigned: kguest
Status: Closed Package: Validate_IE (version CVS)
PHP Version: 5.1.6 OS: n/a
Roadmaps: 0.3.0    
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 : 37 - 28 = ?

 
 [2007-07-30 23:41 UTC] kguest (Ken Guest)
Description: ------------ IE6572557W is a valid vat number according to http://www.braemoor.co.uk/software/vat.shtml and the fact that it is a real-world vat number; found courtesy of google. there is a bug in the checkMOD23 function that calculates the checksum letter should be '@' rather than W. Test script: --------------- <?php include("Validate/IE.php"); $noYes = array('NO', 'YES'); echo $noYes[Validate_IE::vatNumber("IE6572557W")."\n"; ?> Expected result: ---------------- test should pass - display Yes. Actual result: -------------- displays no.

Comments

 [2007-07-30 23:51 UTC] kguest (Ken Guest)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. if the modulus 23 of the calculated total was 0 (ie the total is a multiple of 23) then the checksum was determined to be ascii character 64 - the '@' symbol when it should have been character 64+23 - 'W'.