From b94ac9a9bc957623687bf3cd21548569b96d4a01 Mon Sep 17 00:00:00 2001 From: Juuso Lapinlampi Date: Wed, 6 Jan 2016 13:23:26 +0000 Subject: Fix gyazo response fallthrough to text response The gyazo response would return an empty response, because the construct didn't actually fallthrough to text properly. Force gyazo's response type to be 'text' to fix the issue. Accordingly, the 'gyazo' cases for send() and error() now become dead code. Remove them. OK ewhal@ --- static/classes/Response.class.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'static/classes/Response.class.php') diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php index 3518133..81e7fb4 100755 --- a/static/classes/Response.class.php +++ b/static/classes/Response.class.php @@ -43,8 +43,10 @@ class Response $this->type = $response_type; break; case 'gyazo': - // Deprecated API since version 2.0.0, use text response instead - // fallthrough + // Deprecated API since version 2.0.0, fallback to similar text API + header('Content-Type: text/plain; charset=UTF-8'); + $this->type = 'text'; + break; case 'text': header('Content-Type: text/plain; charset=UTF-8'); $this->type = $response_type; @@ -71,9 +73,6 @@ class Response case 'json': $response = $this->json_error($code, $desc); break; - case 'gyazo': - // Deprecated API since version 2.0.0, use text response instead - // fallthrough case 'text': $response = $this->text_error($code, $desc); break; @@ -97,9 +96,6 @@ class Response case 'json': $response = $this->json_success($files); break; - case 'gyazo': - // Deprecated API since version 2.0.0, use text response instead - // fallthrough case 'text': $response = $this->text_success($files); break; -- cgit v1.2.3