diff --git a/www/gpg.php b/www/gpg.php index 28ef2aa..48a7a78 100644 --- a/www/gpg.php +++ b/www/gpg.php @@ -47,7 +47,7 @@ //if($_SESSION["profile"]["id"] != 5897) //{ // showheader(_("Welcome to CAcert.org")); -// echo "The OpenPGP signing system is currently shutdown due to a security problem. We hope to get it fixed within the next few weeks. We are very sorry for the inconvenience. If you want to help us to fix the problem, please contact our software developers."; +// echo "The OpenPGP signing system is currently shutdown due to a maintenance. We hope to get it fixed within the next few hours. We are very sorry for the inconvenience."; // // exit(0); //} @@ -56,7 +56,7 @@ function verifyName($name) { - if($name == "") return 1; + if($name == "") return 0; if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']) return 1; if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['mname']." ".$_SESSION['profile']['lname']) return 1; if($name == $_SESSION['profile']['fname']." ".$_SESSION['profile']['lname']." ".$_SESSION['profile']['suffix']) return 1; @@ -67,7 +67,7 @@ function verifyName($name) function verifyEmail($email) { - if($email == "") return 1; + if($email == "") return 0; if(mysql_num_rows(mysql_query("select * from `email` where `memid`='".$_SESSION['profile']['id']."' and `email`='".mysql_real_escape_string($email)."' and `deleted`=0 and `hash`=''")) > 0) return 1; return 0; } @@ -111,7 +111,9 @@ function verifyEmail($email) if($bits[6] != "") $expires = 1; } - if(!strstr($line, "@")) continue; + //if(!strstr($line, "@")) continue; + + $pos = strpos($bits[9], "(") - 1; $nocomment = 0; @@ -120,10 +122,16 @@ function verifyEmail($email) $nocomment = 1; $pos = strpos($bits[9], "<") - 1; } + if($pos < 0) + { + $pos = strlen($bits[9]); + } $name = trim(hex2bin(trim(substr($bits[9], 0, $pos)))); $nameok=verifyName($name); $resulttable.="