From 62c9541fefeded5af9b1ac17be3ec156eee26f08 Mon Sep 17 00:00:00 2001 From: Peter Lejeck Date: Sat, 30 Nov 2013 21:31:43 -0800 Subject: Fix output when output isn't set --- static/upload.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'static') diff --git a/static/upload.php b/static/upload.php index df8d9ad..852c5ed 100644 --- a/static/upload.php +++ b/static/upload.php @@ -173,7 +173,9 @@ function respond ($code, $files = null) { $files = $code; } - switch ($_GET['output']) { + $format = array_key_exists('output', $_GET) ? $_GET['output'] : 'json'; + + switch ($format) { case 'gyazo': respond_gyazo($code, $files); break; @@ -181,8 +183,8 @@ function respond ($code, $files = null) { respond_csv($code, $files); break; case 'json': - default: respond_json($code, $files); + break; } } -- cgit v1.2.3