summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xstatic/classes/Response.class.php36
1 files changed, 18 insertions, 18 deletions
diff --git a/static/classes/Response.class.php b/static/classes/Response.class.php
index 48d9311..25d101c 100755
--- a/static/classes/Response.class.php
+++ b/static/classes/Response.class.php
@@ -37,14 +37,14 @@ class Response
case 'gyazo':
// Deprecated API since version 2.0.0
// fallthrough
- case 'text':
- header('Content-Type: text/plain; charset=UTF-8');
- $this->type = $response_type;
- break;
case 'html':
header('Content-Type: text/html; charset=UTF-8');
$this->type = $response_type;
break;
+ case 'text':
+ header('Content-Type: text/plain; charset=UTF-8');
+ $this->type = $response_type;
+ break;
default:
header('Content-Type: application/json; charset=UTF-8');
$this->type = 'json';
@@ -60,12 +60,12 @@ class Response
case 'csv':
$response = $this->csv_error($desc);
break;
- case 'text':
- $response = $this->text_error($code, $desc);
- break;
case 'html':
$response = $this->html_error($code, $desc);
break;
+ case 'text':
+ $response = $this->text_error($code, $desc);
+ break;
default:
$response = $this->json_error($code, $desc);
break;
@@ -83,12 +83,12 @@ class Response
case 'csv':
$response = $this->csv_success($files);
break;
- case 'text':
- $response = $this->text_success($files);
- break;
case 'html':
$response = $this->html_success($files);
break;
+ case 'text':
+ $response = $this->text_success($files);
+ break;
default:
$response = $this->json_success($files);
break;
@@ -116,29 +116,29 @@ class Response
return $result;
}
- private static function text_error($code, $description)
+ private static function html_error($code, $description)
{
- return 'ERROR: ('.$code.') '.$description;
+ return '<p>ERROR: ('.$code.') '.$description.'</p>';
}
- private static function text_success($files)
+ private static function html_success($files)
{
foreach ($files as $file) {
- $result .= $file['url']."\n";
+ $result .= '<a href="'.$file['url'].'">'.$file['url'].'</a><br>';
}
return $result;
}
- private static function html_error($code, $description)
+ private static function text_error($code, $description)
{
- return '<p>ERROR: ('.$code.') '.$description.'</p>';
+ return 'ERROR: ('.$code.') '.$description;
}
- private static function html_success($files)
+ private static function text_success($files)
{
foreach ($files as $file) {
- $result .= '<a href="'.$file['url'].'">'.$file['url'].'</a><br>';
+ $result .= $file['url']."\n";
}
return $result;