--- cacert_orig/www/gpg.php	2005-02-16 19:12:13.000000000 +0100
+++ cacert/www/gpg.php	2005-08-21 03:10:00.000000000 +0200
@@ -36,21 +36,33 @@
 	if($oldid == "0")
 	{
 		$gpgkey = $_POST['CSR'];
-		$gpg = `echo "$gpgkey"|gpg --with-colons --homedir /tmp 2>&1`;
+		$gpg = `echo "$gpgkey"|gpg --with-colons -v --homedir /tmp 2>&1`;
+		$gpgarray = explode("\n", $gpg);
 		$lines = "";
-		foreach(explode("\n", $gpg) as $line)
+		$skip = 0;
+		for($i=count($gpgarray)-1; $i >= 0; $i--)
 		{
-			if(substr($line, 0, 3) == "pub" || substr($line, 0, 3) == "uid")
+			if(substr($gpgarray[$i], 0, 3) == "rev")
 			{
+				$skip=1;
+				continue;
+			}
+			if(substr(gpgarray[$i], 0, 3) == "pub" || substr(gpgarray[$i], 0, 3) == "uid")
+			{
+				if($skip)
+				{
+					$skip = 0;
+					continue;
+				}
 				if($lines != "")
 					$lines .= "\n";
-				$lines .= $line;
+				$lines .= gpgarray[$i];
 			}
 		}
 		$gpg = $lines;
 		$expires = 0;
 
-		foreach(explode("\n", $gpg) as $line)
+		foreach($gpgarray as $line)
 		{
 			$name = $comment = "";
 			$bits = explode(":", $line);
