Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/format.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/format.php')
-rw-r--r--lib/format.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/format.php b/lib/format.php
index c250c8a..8731eb0 100644
--- a/lib/format.php
+++ b/lib/format.php
@@ -8,23 +8,23 @@ require_once "../init.php";
include_once BASE . "/lib/http.php";
function export_as_requested($content) {
- if (isset($_GET["json"])) {
+ if (isset($content["json"]) && isset($_GET["json"])) {
header ("Content-type: application/json");
print json_encode(
- $content,
+ $content["json"],
JSON_UNESCAPED_SLASHES
);
- } elseif (isset($_GET["tsv"])) {
+ } elseif (isset($content["tsv"]) && isset($_GET["tsv"])) {
header ("Content-type: text/tab-separated-values");
if (! isset($_GET["no-headers"]))
- print implode("\t",array_keys($content[0])) . "\n";
+ print implode("\t",array_keys($content["tsv"][0])) . "\n";
print implode(
"\n",
array_map(
function($row){
return implode("\t",$row);
},
- $content
+ $content["tsv"]
)
);
} else {