diff --git a/include/ajax.users.php b/include/ajax.users.php index 55008661d6..1a1dbb18e8 100644 --- a/include/ajax.users.php +++ b/include/ajax.users.php @@ -34,7 +34,7 @@ function search($type = null, $fulltext=false) { if (!$_REQUEST['q']) return $this->json_encode($matches); - $q = $_REQUEST['q']; + $q = Format::sanitize($_REQUEST['q']); $limit = isset($_REQUEST['limit']) ? (int) $_REQUEST['limit']:25; $users=array(); $emails=array(); @@ -107,7 +107,7 @@ function search($type = null, $fulltext=false) { } $name = Format::htmlchars(new UsersName($name)); $matches[] = array('email'=>$email, 'name'=>$name, 'info'=>"$email - $name", - "id" => $id, "/bin/true" => $_REQUEST['q']); + "id" => $id, "/bin/true" => $q); } usort($matches, function($a, $b) { return strcmp($a['name'], $b['name']); }); } diff --git a/include/class.client.php b/include/class.client.php index b7b48d3c77..b2d32232a4 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -484,7 +484,7 @@ function update($vars, &$errors) { if ($vars['backend']) { $this->set('backend', $vars['backend']); if ($vars['username']) - $this->set('username', $vars['username']); + $this->set('username', Format::sanitize($vars['username'])); } if ($vars['passwd1']) { diff --git a/include/class.user.php b/include/class.user.php index 67f7750345..08373d10d0 100644 --- a/include/class.user.php +++ b/include/class.user.php @@ -1320,7 +1320,7 @@ function update($vars, &$errors) { } $this->set('timezone', $vars['timezone']); - $this->set('username', $vars['username']); + $this->set('username', Format::sanitize($vars['username'])); if ($vars['passwd1']) { $this->setPassword($vars['passwd1']); @@ -1398,7 +1398,7 @@ static function register($user, $vars, &$errors) { )); if ($vars['username'] && strcasecmp($vars['username'], $user->getEmail())) - $account->set('username', $vars['username']); + $account->set('username', Format::sanitize($vars['username'])); if ($vars['passwd1'] && !$vars['sendemail']) { $account->set('passwd', Passwd::hash($vars['passwd1'])); diff --git a/include/staff/templates/user-account.tmpl.php b/include/staff/templates/user-account.tmpl.php index d958ab2782..6b79683071 100644 --- a/include/staff/templates/user-account.tmpl.php +++ b/include/staff/templates/user-account.tmpl.php @@ -90,7 +90,7 @@ : - + " data-content=": - -    + +