aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/users.php5
-rw-r--r--pages/avatar/view.php12
2 files changed, 10 insertions, 7 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index e7e1a57f0..48f10f974 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1383,7 +1383,10 @@ function elgg_profile_fields_setup() {
function elgg_avatar_page_handler($page) {
global $CONFIG;
- set_input('username', $page[1]);
+ $user = get_user_by_username($page[1]);
+ if ($user) {
+ elgg_set_page_owner_guid($user->getGUID());
+ }
if ($page[0] == 'edit') {
require_once("{$CONFIG->path}pages/avatar/edit.php");
diff --git a/pages/avatar/view.php b/pages/avatar/view.php
index 55ae00e16..eb2cd1010 100644
--- a/pages/avatar/view.php
+++ b/pages/avatar/view.php
@@ -13,9 +13,9 @@ if (!in_array($size, array('master', 'large', 'medium', 'small', 'tiny', 'topbar
// If user doesn't exist, return default icon
if (!$user) {
- $path = elgg_view("icon/user/default/$size");
- header("Location: $path");
- exit;
+ $url = "_graphics/icons/user/default{$size}";
+ $url = elgg_normalize_url($url);
+ forward($url);
}
// Try and get the icon
@@ -31,9 +31,9 @@ if ($filehandler->open("read")) {
}
if (!$success) {
- $path = elgg_view('icon/user/default/'.$size);
- header("Location: {$path}");
- exit;
+ $url = "_graphics/icons/user/default{$size}";
+ $url = elgg_normalize_url($url);
+ forward($url);
}
header("Content-type: image/jpeg");