aboutsummaryrefslogtreecommitdiffstats
path: root/core/avatar
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-09-05 23:12:52 +0200
committerkondou <kondou@ts.unde.re>2013-09-05 23:12:52 +0200
commit3774632eccd255c0e8a57afc445ef659964fd63b (patch)
tree9d42e585b97e83035479a2bb5b1717b8f67b6ba0 /core/avatar
parent15ab79835379559c369c2d1b56ace72e02cb6d1e (diff)
downloadnextcloud-server-3774632eccd255c0e8a57afc445ef659964fd63b.tar.gz
nextcloud-server-3774632eccd255c0e8a57afc445ef659964fd63b.zip
Clean up avatars and preliminary use JSON->rawlist.php
Diffstat (limited to 'core/avatar')
-rw-r--r--core/avatar/controller.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/avatar/controller.php b/core/avatar/controller.php
index 03482ee1070..55fdd7f74a0 100644
--- a/core/avatar/controller.php
+++ b/core/avatar/controller.php
@@ -32,7 +32,7 @@ class Controller {
\OC_Response::setETagHeader(crc32($image->data()));
$image->show();
} else {
- \OC_JSON::success(array('user' => $user, 'size' => $size));
+ \OC_JSON::success();
}
}
@@ -74,11 +74,9 @@ class Controller {
\OC_JSON::error(array("data" => array("message" => "notsquare") ));
} else {
$l = new \OC_L10n('core');
- $type = substr($image->mimeType(), -3);
- if ($type === 'peg') {
- $type = 'jpg';
- }
- if ($type !== 'jpg' && $type !== 'png') {
+
+ $mimeType = $image->mimeType();
+ if ($mimeType !== 'image/jpeg' && $mimeType !== 'image/png') {
\OC_JSON::error(array("data" => array("message" => $l->t("Unknown filetype")) ));
}