aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/users.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/users.php')
-rw-r--r--engine/lib/users.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/engine/lib/users.php b/engine/lib/users.php
index 36e137876..ce1b409f6 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -813,6 +813,7 @@ function validate_username($username) {
if (
preg_match($blacklist, $username)
) {
+ // @todo error message needs work
throw new RegistrationException(elgg_echo('registration:invalidchars'));
}
@@ -823,6 +824,7 @@ function validate_username($username) {
for ($n = 0; $n < strlen($blacklist2); $n++) {
if (strpos($username, $blacklist2[$n]) !== false) {
$msg = elgg_echo('registration:invalidchars', array($blacklist2[$n], $blacklist2));
+ $msg = htmlentities($msg, ENT_COMPAT, 'UTF-8');
throw new RegistrationException($msg);
}
}
@@ -1222,12 +1224,14 @@ function elgg_user_hover_menu($hook, $type, $return, $params) {
if ($user->isFriend()) {
$url = "action/friends/remove?friend={$user->guid}";
$text = elgg_echo('friend:remove');
+ $name = 'remove_friend';
} else {
$url = "action/friends/add?friend={$user->guid}";
$text = elgg_echo('friend:add');
+ $name = 'add_friend';
}
$url = elgg_add_action_tokens_to_url($url);
- $item = new ElggMenuItem('addfriend', $text, $url);
+ $item = new ElggMenuItem($name, $text, $url);
$item->setSection('action');
$return[] = $item;
} else {