FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=18118&edit=1

ID: 18118
Updated by: daniel.oconnor@gmail.com
Reported By: ken at kenhaynes dot com
Summary: Incorrect validation
-Status: Open
+Status: Closed
Type: Bug
Package: Validate_US
Operating System: XP Pro SP3
Package Version: 0.5.4
PHP Version: 5.3.3
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:

-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 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.




Previous Comments:
------------------------------------------------------------------------

[2011-01-11 09:35:54] alec

Added #patch bug:18118;patch:US-ssn.patch;revision:1294738553;.

------------------------------------------------------------------------

[2011-01-11 09:35:16] alec

I think the reason is in ssnGetHighGroups(). It fetches data from
http://www.socialsecurity.gov/employer/ssnvs/highgroup.txt. 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.

------------------------------------------------------------------------

[2010-12-16 10:17:03] doconnor

I don't suppose you are able to point us to documentation where SSNs
have changed checksums; and derive others which *should* be valid?

------------------------------------------------------------------------

[2010-12-16 06:33:58] kenhaynes

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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 10, '11 at 12:35p
activeDec 10, '11 at 12:35p
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase