Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 1d7e9ef

Browse files
committed
Simple filtering on users autocompleter
1 parent 88e4865 commit 1d7e9ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/plugins/core.conf/AbstractConfDriver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,8 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
11441144
if (method_exists($this, "listUserTeams")) {
11451145
$teams = $this->listUserTeams($ctx->getUser());
11461146
foreach ($teams as $tId => $tData) {
1147-
$users.= "<li class='complete_group_entry' data-group='/AJXP_TEAM/$tId' data-label=\"[team] ".$tData["LABEL"]."\"><span class='user_entry_label'>[team] ".$tData["LABEL"]."</span></li>";
1147+
$label = htmlentities($tData["LABEL"]);
1148+
$users.= "<li class='complete_group_entry' data-group='/AJXP_TEAM/$tId' data-label=\"[team] ".$label."\"><span class='user_entry_label'>[team] ".$label."</span></li>";
11481149
}
11491150
}
11501151
print("<ul>$users</ul>");
@@ -1221,6 +1222,9 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
12211222

12221223
$users = "";
12231224
$index = 0;
1225+
if(!empty($crtValue)){
1226+
$crtValue = InputFilter::sanitize($crtValue, InputFilter::SANITIZE_HTML_STRICT);
1227+
}
12241228
if ($regexp != null && (!count($allUsers) || (!empty($crtValue) && !array_key_exists(strtolower($crtValue), $allUsers))) && ConfService::getContextConf($ctx, "USER_CREATE_USERS", "conf") && !$existingOnly) {
12251229
$users .= "<li class='complete_user_entry_temp' data-temporary='true' data-label='$crtValue'><span class='user_entry_label'>$crtValue (".$mess["448"].")</span></li>";
12261230
} else if ($existingOnly && !empty($crtValue)) {

0 commit comments

Comments
 (0)