From 2f376bfc5fa1e6c7f52a1eb0079409f27ed9b0cd Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 31 Aug 2010 00:24:09 +0000 Subject: Refs #2434 - made the profile plugin more robust to bad urls and did a little code standardization git-svn-id: http://code.elgg.org/elgg/trunk@6885 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/start.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mod/profile/start.php') diff --git a/mod/profile/start.php b/mod/profile/start.php index adac92aef..80f923cb3 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -121,18 +121,18 @@ function profile_fields_setup() { function profile_page_handler($page) { global $CONFIG; - $username = $action = NULL; + $action = NULL; // short circuit if invalid or banned username if (isset($page[0])) { $username = $page[0]; $user = get_user_by_username($username); + set_input('username', $page[0]); + } - if (!$user || ($user->isBanned() && !isadminloggedin())) { - return elgg_echo('profile:notfound'); - } else { - set_input('username', $page[0]); - } + if (!$user || ($user->isBanned() && !isadminloggedin())) { + register_error(elgg_echo('profile:notfound')); + forward(); } if (isset($page[1])) { -- cgit v1.2.3