index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
-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( "", |