aboutsummaryrefslogtreecommitdiff
path: root/actions/avatar
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-10-01 19:53:37 -0400
committerCash Costello <cash.costello@gmail.com>2011-10-01 19:53:37 -0400
commit8be10bb100a6a4d9abc6bf7ee928d5c2e60004de (patch)
treec6d2fd80bf56255cb5e62e19322dc2e743396f10 /actions/avatar
parentdc0a24816ee224962511739b312898ffaf19d8ae (diff)
downloadelgg-8be10bb100a6a4d9abc6bf7ee928d5c2e60004de.tar.gz
elgg-8be10bb100a6a4d9abc6bf7ee928d5c2e60004de.tar.bz2
Fixes #3912 checking that the upload succeeded before resizing
Diffstat (limited to 'actions/avatar')
-rw-r--r--actions/avatar/upload.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/actions/avatar/upload.php b/actions/avatar/upload.php
index 19976ea87..885a16557 100644
--- a/actions/avatar/upload.php
+++ b/actions/avatar/upload.php
@@ -11,6 +11,11 @@ if (!$owner || !($owner instanceof ElggUser) || !$owner->canEdit()) {
forward(REFERER);
}
+if ($_FILES['avatar']['error'] != 0) {
+ register_error(elgg_echo('avatar:upload:fail'));
+ forward(REFERER);
+}
+
//@todo make this configurable?
$icon_sizes = array(
'topbar' => array('w'=>16, 'h'=>16, 'square'=>TRUE, 'upscale'=>TRUE),
@@ -42,7 +47,7 @@ foreach ($icon_sizes as $name => $size_info) {
$file->delete();
}
- system_message(elgg_echo('avatar:resize:fail'));
+ register_error(elgg_echo('avatar:resize:fail'));
forward(REFERER);
}
}