index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-02-18 20:12:17 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-02-18 20:12:17 +0100 |
commit | 4c6b074e85d7d8e97b9f125f5fbc2949bc8839dd (patch) | |
tree | b1049ef75f830be56aa5dbba951872d794b11b2a /lib/format.php | |
parent | 4376c50ded25fff8ab6c59c045522091b3eb038b (diff) |
-rw-r--r-- | lib/format.php | 6 |
diff --git a/lib/format.php b/lib/format.php index 72cf531..25748f0 100644 --- a/lib/format.php +++ b/lib/format.php @@ -12,15 +12,15 @@ function export_as_requested($content) { $content["tsv"]=$content["All"]; unset($content["All"]); } - if (isset($content["json"]) && isset($_GET["json"])) { + if (isset($content["json"]) && array_key_exists("json", $_GET)) { header ("Content-type: application/json"); print json_encode( $content["json"], JSON_UNESCAPED_SLASHES ); - } elseif (isset($content["tsv"]) && isset($_GET["tsv"])) { + } elseif (isset($content["tsv"]) && array_key_exists("tsv", $_GET)) { header ("Content-type: text/tab-separated-values"); - if (! isset($_GET["no-headers"])) + if (! array_key_exists("no-headers", $_GET)) print implode("\t",array_keys($content["tsv"][0])) . "\n"; print implode( "", |