summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-12 14:58:35 +0200
committerkondou <kondou@ts.unde.re>2013-08-25 21:05:40 +0200
commit9500109349f94546e4b43f6af755b20064ee9a64 (patch)
tree91eee719482f23de10b586474d660fc696b01093 /lib
parent33827d690e8fd94eed3d4cedeac9bb37260e6c1a (diff)
downloadnextcloud-server-9500109349f94546e4b43f6af755b20064ee9a64.tar.gz
nextcloud-server-9500109349f94546e4b43f6af755b20064ee9a64.zip
Refactor newavatar.php and show (for now) an alert on problems when setting new avatars
Diffstat (limited to 'lib')
-rw-r--r--lib/avatar.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/avatar.php b/lib/avatar.php
index 1ee1e5e742f..49c82709154 100644
--- a/lib/avatar.php
+++ b/lib/avatar.php
@@ -65,11 +65,13 @@ class OC_Avatar {
$type = substr($img->mimeType(), -3);
if ($type === 'peg') { $type = 'jpg'; }
if ($type !== 'jpg' && $type !== 'png') {
- throw new Exception("Unknown filetype for avatar");
+ $l = \OC_L10N::get('lib');
+ throw new \Exception($l->t("Unknown filetype for avatar"));
}
if (!( $img->valid() && ($img->height() === $img->width()) )) {
- throw new Exception("Invalid image, or the provided image is not square");
+ $l = \OC_L10N::get('lib');
+ throw new \Exception($l->t("Invalid image, or the provided image is not square"));
}
$view->unlink('avatar.jpg');