aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/start.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-31 00:24:09 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-31 00:24:09 +0000
commit2f376bfc5fa1e6c7f52a1eb0079409f27ed9b0cd (patch)
treecc8ee6cfafa0e54325591af933d1c16321d33e73 /mod/profile/start.php
parent6bb6cb7ef6c30f01c5f9e5a75f383eb9d19184ae (diff)
downloadelgg-2f376bfc5fa1e6c7f52a1eb0079409f27ed9b0cd.tar.gz
elgg-2f376bfc5fa1e6c7f52a1eb0079409f27ed9b0cd.tar.bz2
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
Diffstat (limited to 'mod/profile/start.php')
-rw-r--r--mod/profile/start.php12
1 files changed, 6 insertions, 6 deletions
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])) {