Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-09-02 15:18:59 +0200
committerErich Eckner <git@eckner.net>2019-09-02 15:18:59 +0200
commit368bf08c7831cf183a0fa3a7a8d8d30851152a54 (patch)
tree72bc5555061e2158f0d7d17c6c80eada5fa43007
parent474c67778253ee71eb07e4f24e64d55839024573 (diff)
keys.php: do not print listing
-rw-r--r--keys.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/keys.php b/keys.php
index b5e6f8f..5b398fc 100644
--- a/keys.php
+++ b/keys.php
@@ -2,16 +2,17 @@
require_once "init.php";
-if (array_key_exists('k', $_GET)
-&& (preg_match('/^[0-9A-Fa-f]{40}$/', $_GET['k']) !== false))
- $output = shell_exec('gpg -a --export ' . $_GET['k']);
- print $output;
- if (empty($output)) {
- $fh = fopen('key-wishlist', 'a');
- if ($fh !== false) {
- fwrite($fh, $_GET['k'] . "\n");
- fclose($fh);
- }
+if (!array_key_exists('k', $_GET))
+ die();
+if (preg_match('/^[0-9A-Fa-f]{40}$/', $_GET['k']) === false)
+ die();
+
+$output = shell_exec('gpg -a --export ' . $_GET['k']);
+print $output;
+if (empty($output)) {
+ $fh = fopen('key-wishlist', 'a');
+ if ($fh !== false) {
+ fwrite($fh, $_GET['k'] . "\n");
+ fclose($fh);
}
-else
- print shell_exec('gpg --list-keys --with-colons');
+}