summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-07-10 09:29:32 +0200
committerErich Eckner <git@eckner.net>2018-07-10 09:29:32 +0200
commitc634b6177e011be129f6c740b651d29307bc4c7e (patch)
treef64b2ac91fd614e1b8befd33377ddb35abe5854c /lib
parent1bdfa0fa9de78c1139c300292d9d47e8e11d3ab0 (diff)
downloadarchweb32-c634b6177e011be129f6c740b651d29307bc4c7e.tar.xz
lib/format.php: make error on unkown type more verbose
Diffstat (limited to 'lib')
-rw-r--r--lib/format.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/format.php b/lib/format.php
index 8731eb0..6c18648 100644
--- a/lib/format.php
+++ b/lib/format.php
@@ -28,6 +28,26 @@ function export_as_requested($content) {
)
);
} else {
- throw_http_error(406,"Not Acceptable","Unknown output format.");
+ throw_http_error(
+ 406,
+ "Not Acceptable",
+ implode(
+ "<br>\n",
+ array_merge(
+ array(
+ "Unknown output format.",
+ "Accepted:"
+ ),
+ array_map(
+ function($type){
+ return "<a href=\"?" . $type . "\">" . $type . "</a>";
+ },
+ array_keys(
+ $content
+ )
+ )
+ )
+ )
+ );
}
}