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

Bug #20237 PPS number not validating correctly for new 9 char length numbers
Submitted: 2014-04-07 22:15 UTC
From: moonraking Assigned: kguest
Status: Closed Package: Validate_IE (version 1.1.0a1)
PHP Version: 5.3.28 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2014-04-07 22:15 UTC] moonraking (Shane McShane)
Description: ------------ The checkmod32 function needs to be updated to take into account a 9 char pps number Test script: --------------- var_dump( Validate_IE::ppsn('1297188CA') ); Expected result: ---------------- bool(true) Actual result: -------------- bool(false) its failing in checkMod32(). For my own use I have reimplemented (successfully) using algorithm linked from the wikipedia page on Irish PPS's http://pmhsilva.com/2013/02/12/validate-irish-ppsn-with-javascript-jquery/ I feel checkMod32 should be changed to getCheckCode($number_part, $check_code_part) and return the checksum. That way getCheckCode can be used in validation code to inform the user what the checkcode might be, maybe they entered up an I instead of an L. Yes, they could have entered a number wrong, but every little helps.... shane

Comments

 [2014-04-07 22:33 UTC] kguest (Ken Guest)
-Assigned To: +Assigned To: kguest
 [2014-04-08 01:45 UTC] kguest (Ken Guest)
-Summary: PPS number not validaing correctly for new 9 char numbers +Summary: PPS number not validating correctly for new 9 char length numbers
 [2014-04-09 02:29 UTC] kguest (Ken Guest)
-Status: Assigned +Status: Closed
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/ I've pushed out a new release, https://pear.php.net/package/Validate_IE/download/1.1.0a2 which addresses this problem for 9 character lenght PPSN strings; might add your proposed getCheckCode function in a new release soon :-) Thanks for your help with this.