diff options
author | INOPIAE <inopiae@cacert.org> | 2013-05-01 00:24:45 +0200 |
---|---|---|
committer | INOPIAE <inopiae@cacert.org> | 2013-05-01 00:24:45 +0200 |
commit | 8c4068f534f61c53d113ad443ead6277eb8a874c (patch) | |
tree | 64080ad4615f0a162adb2b2c124fa861c8480d23 /includes | |
parent | 1f1d532b4da4d74e0139ab4ffa62cb51a48100da (diff) | |
download | cacert-devel-8c4068f534f61c53d113ad443ead6277eb8a874c.tar.gz cacert-devel-8c4068f534f61c53d113ad443ead6277eb8a874c.tar.xz cacert-devel-8c4068f534f61c53d113ad443ead6277eb8a874c.zip |
bug 893: adjusted preg_match and cert duration check
Diffstat (limited to 'includes')
-rw-r--r-- | includes/account.php | 2 | ||||
-rw-r--r-- | includes/temp_functions.php | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/includes/account.php b/includes/account.php index 23a48f4..3a33a5e 100644 --- a/includes/account.php +++ b/includes/account.php @@ -2847,7 +2847,7 @@ showfooter(); exit; } - if ( 1 !== preg_match_all('/^[a-z]\d{8}\.\d+\.\d+$/',trim($_REQUEST['arbitrationno'])) ) { + if ( 1 !== preg_match('/^[a-z]\d{8}\.\d+\.\d+$/i',trim($_REQUEST['arbitrationno'])) ) { showheader(_("My CAcert.org Account!")); echo _("You did not enter an arbitration number entry."); showfooter(); diff --git a/includes/temp_functions.php b/includes/temp_functions.php index 14f69ff..e7a111a 100644 --- a/includes/temp_functions.php +++ b/includes/temp_functions.php @@ -172,7 +172,7 @@ function check_gpg_cert_running($uid,$cca=0){ if (0==$cca) { $query = "select * from `gpg` where `memid`='$uid' and `expire`>NOW()"; }else{ - $query = "select * from `gpg` where `memid`='$uid' and `expire`>NOW()+90*86400"; + $query = "select * from `gpg` where `memid`='$uid' and `expire`>NOW()-90*86400"; } $res = mysql_query($query); return mysql_num_rows($res) > 0; @@ -186,8 +186,8 @@ function check_client_cert_running($uid,$cca=0){ $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()"; $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()"; }else{ - $query1 = "select from `emailcerts` where `memid`='$uid' and `expire`>NOW()+90*86400"; - $query2 = "select from `emailcerts` where `memid`='$uid' and `revoked`>NOW()+90*86400"; + $query1 = "select from `emailcerts` where `memid`='$uid' and `expire`>NOW()-90*86400"; + $query2 = "select from `emailcerts` where `memid`='$uid' and `revoked`>NOW()-90*86400"; } $res = mysql_query($query1); $r1 = mysql_num_rows($res)>0; @@ -204,8 +204,8 @@ function check_server_cert_running($uid,$cca=0){ $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()"; $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()"; }else{ - $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()+90*86400"; - $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()+90*86400"; + $query1 = "select from `domiancerts` where `memid`='$uid' and `expire`>NOW()-90*86400"; + $query2 = "select from `domiancerts` where `memid`='$uid' and `revoked`>NOW()-90*86400"; } $res = mysql_query($query1); $r1 = mysql_num_rows($res)>0; |