View Issue Details

IDProjectCategoryView StatusLast Update
0000618Test1.cacert.atpublic2013-01-10 17:49
Reporterwolfman Assigned ToSourcerer  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Summary0000618: date of birth - absolutelly no sanity checks
DescriptionThe value for "date of birth" is not checked at all. I tried different things like:

- date in future
- date not possible (like 31. Feb.)

there are no complaints. I think the system should at least check that the date is possible and in the future.
TagsNo tags attached.
Attached Files
datecheck.patch (809 bytes)   
--- cacert/www/index.php	2008-10-06 22:29:20.000000000 +0100
+++ cacert/www/index.php	2008-11-13 16:58:56.000000000 +0000
@@ -432,7 +432,9 @@
 			$_SESSION['_config']['errmsg'] .= _("First and/or last names were blank.")."<br>\n";
 		}
 		if($_SESSION['signup']['year'] < 1900 || $_SESSION['signup']['month'] < 1 || $_SESSION['signup']['month'] > 12 ||
-			$_SESSION['signup']['day'] < 1 || $_SESSION['signup']['day'] > 31)
+			$_SESSION['signup']['day'] < 1 || $_SESSION['signup']['day'] > 31 ||
+			!checkdate($_SESSION['signup']['month'],$_SESSION['signup']['day'],$_SESSION['signup']['year']) ||
+			mktime(0,0,0,$_SESSION['signup']['month'],$_SESSION['signup']['day'],$_SESSION['signup']['year']) > time(now) )
 		{
 			$id = 1;
 			$_SESSION['_config']['errmsg'] .= _("Invalid date of birth")."<br>\n";
datecheck.patch (809 bytes)   

Relationships

related to 0000583 closed Main CAcert Website "Assure Somebody" allows future assurance dates 

Activities

Gaz

2008-11-13 17:04

reporter   ~0001254

I have attached a patch that should solve both these validation issues.

Sourcerer

2009-04-10 22:01

administrator   ~0001366

The "time(now)" piece of the patch does not work on PHP. time() does not take an argument, and now isn't a defined name. time() should be used instead.

Sourcerer

2009-04-10 22:21

administrator   ~0001367

Patch has been adapted and applied. Please test and close the bug.

Issue History

Date Modified Username Field Change
2008-09-19 07:31 wolfman New Issue
2008-11-13 17:03 Gaz File Added: datecheck.patch
2008-11-13 17:04 Gaz Note Added: 0001254
2009-04-10 22:01 Sourcerer Note Added: 0001366
2009-04-10 22:21 Sourcerer Note Added: 0001367
2009-04-10 22:21 Sourcerer Status new => solved?
2009-04-10 22:21 Sourcerer Resolution open => fixed
2009-04-10 22:21 Sourcerer Assigned To => Sourcerer
2009-04-26 14:43 Sourcerer Status solved? => closed
2013-01-10 17:49 Werner Dworak Relationship added related to 0000583