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

Bug #18118 Incorrect validation
Submitted: 2010-12-16 11:33 UTC
From: kenhaynes Assigned: doconnor
Status: Closed Package: Validate_US (version 0.5.4)
PHP Version: 5.3.3 OS: XP Pro SP3
Roadmaps: (Not assigned)    

 [2010-12-16 11:33 UTC] kenhaynes (Ken Haynes)
Description: ------------ Hi, I have just downloaded and installed Validate_US. I have only been in the US for 2 years and my SSN is returned as Invalid". I tried my wife's SSN using the same format and it returned "Valid". I believe this has to do with the later SSNs so I thought that I had better draw this to your attention so that it can be caught before it is released from beta and starts to affect people's scripts. I have not given my SSN in the code example for security reasons, but please let me know if I can be of further assistance. Regards, Ken. Test script: --------------- include_once 'Validate/us.php'; $validate = new Validate_US(); echo $validate->ssn("xxx-xx-xxxx") ? "Valid SSN<br />" : "Invalid SSN<br />"; Expected result: ---------------- "Valid SSN" should be displayed. Actual result: -------------- "Invalid SSN" is displayed.


 [2010-12-16 15:17 UTC] doconnor (Daniel O'Connor)
I don't suppose you are able to point us to documentation where SSNs have changed checksums; and derive others which *should* be valid?
 [2011-01-11 14:35 UTC] alec (Aleksander Machniak)
I think the reason is in ssnGetHighGroups(). It fetches data from I see that regexp in this function (line 200) doesn't handle last line of the data. This file shouldn't be parsed line-by-line, but in a loop on every 5 characters. Attached patch with some additional CS fixes.
 [2011-01-11 14:35 UTC] alec (Aleksander Machniak)
 [2011-12-10 18:35 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.