From 9fe063022e08a4b6fa5f5935f8f185d5d95814a4 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 25 Apr 2012 19:09:22 +0200 Subject: Upgraded to Elgg 1.8.4. --- actions/avatar/crop.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'actions/avatar') diff --git a/actions/avatar/crop.php b/actions/avatar/crop.php index 6d71b6f06..b9a80f331 100644 --- a/actions/avatar/crop.php +++ b/actions/avatar/crop.php @@ -22,6 +22,12 @@ $filehandler->owner_guid = $owner->getGUID(); $filehandler->setFilename("profile/" . $owner->guid . "master" . ".jpg"); $filename = $filehandler->getFilenameOnFilestore(); +// ensuring the avatar image exists in the first place +if (!file_exists($filename)) { + register_error(elgg_echo('avatar:crop:fail')); + forward(REFERER); +} + $icon_sizes = elgg_get_config('icon_sizes'); unset($icon_sizes['master']); @@ -46,7 +52,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); } } -- cgit v1.2.3