diff options
author | kondou <kondou@ts.unde.re> | 2013-09-05 23:12:52 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-09-05 23:12:52 +0200 |
commit | 3774632eccd255c0e8a57afc445ef659964fd63b (patch) | |
tree | 9d42e585b97e83035479a2bb5b1717b8f67b6ba0 /core/avatar | |
parent | 15ab79835379559c369c2d1b56ace72e02cb6d1e (diff) | |
download | nextcloud-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.php | 10 |
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")) )); } |