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

Commit 013f337

Browse files
committed
xmlEntities special chars in user_list_authorized_users action for XML parsing.
Remove text ellipsis on user-badge-label for better handling of long group names. Fix gui-debug template
1 parent 079f906 commit 013f337

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

core/src/plugins/action.share/res/react-share-form.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,8 @@ div#react_share_form div.user-badge .user-badge-label {
284284
-webkit-flex: 5;
285285
-ms-flex: 5;
286286
flex: 5;
287-
padding: 13px 0;
288-
white-space: nowrap;
289-
overflow: hidden;
290-
text-overflow: ellipsis;
287+
padding: 9px 0;
288+
line-height: 25px;
291289
}
292290
div#react_share_form div.user-badge:last-of-type {
293291
border-bottom: 0;

core/src/plugins/action.share/res/react-share-form.less

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,10 +299,8 @@ div#react_share_form {
299299
flex-direction: row;
300300
.user-badge-label {
301301
flex: 5;
302-
padding: 13px 0;
303-
white-space: nowrap;
304-
overflow: hidden;
305-
text-overflow: ellipsis;
302+
padding: 9px 0;
303+
line-height: 25px;
306304
}
307305
&:last-of-type {
308306
border-bottom: 0;

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
use Pydio\Core\PluginFramework\Plugin;
5555
use Pydio\Core\PluginFramework\PluginsService;
5656
use Pydio\Core\Services\ConfService;
57+
use Pydio\Core\Utils\Vars\StringHelper;
5758
use Zend\Diactoros\Response\JsonResponse;
5859

5960
defined('AJXP_EXEC') or die( 'Access not allowed');
@@ -1226,19 +1227,20 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
12261227
$crtValue = InputFilter::sanitize($crtValue, InputFilter::SANITIZE_HTML_STRICT);
12271228
}
12281229
if ($regexp != null && (!count($allUsers) || (!empty($crtValue) && !array_key_exists(strtolower($crtValue), $allUsers))) && ConfService::getContextConf($ctx, "USER_CREATE_USERS", "conf") && !$existingOnly) {
1229-
$users .= "<li class='complete_user_entry_temp' data-temporary='true' data-label='$crtValue'><span class='user_entry_label'>$crtValue (".$mess["448"].")</span></li>";
1230+
$users .= "<li class='complete_user_entry_temp' data-temporary='true' data-label=\"".StringHelper::xmlEntities($crtValue)."\"><span class='user_entry_label'>".StringHelper::xmlEntities($crtValue." (".$mess["448"]).")</span></li>";
12301231
} else if ($existingOnly && !empty($crtValue)) {
1231-
$users .= "<li class='complete_user_entry_temp' data-temporary='true' data-label='$crtValue' data-entry_id='$crtValue'><span class='user_entry_label'>$crtValue</span></li>";
1232+
$users .= "<li class='complete_user_entry_temp' data-temporary='true' data-label=\"".StringHelper::xmlEntities($crtValue)."\" data-entry_id=\"".StringHelper::xmlEntities($crtValue)."\"><span class='user_entry_label'>".StringHelper::xmlEntities($crtValue)."</span></li>";
12321233
}
12331234
$mess = LocaleService::getMessages();
12341235
if (!$usersOnly && (empty($regexp) || preg_match($pregexp, $mess["447"]))) {
1235-
$users .= "<li class='complete_group_entry' data-group='AJXP_GRP_/' data-label=\"".$mess["447"]."\"><span class='user_entry_label'>".$mess["447"]."</span></li>";
1236+
$users .= "<li class='complete_group_entry' data-group='AJXP_GRP_/' data-label=\"".StringHelper::xmlEntities($mess["447"])."\"><span class='user_entry_label'>".StringHelper::xmlEntities($mess["447"])."</span></li>";
12361237
}
12371238
$indexGroup = 0;
12381239
if (!$usersOnly && isset($allGroups) && is_array($allGroups)) {
12391240
foreach ($allGroups as $groupId => $groupLabel) {
12401241
if ($regexp == null || preg_match($pregexp, $groupLabel)) {
1241-
$users .= "<li class='complete_group_entry' data-group='$groupId' data-label=\"$groupLabel\" data-entry_id='$groupId'><span class='user_entry_label'>".$groupLabel."</span></li>";
1242+
$groupLabel = StringHelper::xmlEntities($groupLabel);
1243+
$users .= "<li class='complete_group_entry' data-group='$groupId' data-label=\"".$groupLabel."\" data-entry_id='$groupId'><span class='user_entry_label'>".$groupLabel."</span></li>";
12421244
$indexGroup++;
12431245
}
12441246
if($indexGroup == $limit) break;
@@ -1248,7 +1250,8 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
12481250
$teams = $this->listUserTeams($ctx->getUser());
12491251
foreach ($teams as $tId => $tData) {
12501252
if($regexp == null || preg_match($pregexp, $tData["LABEL"])){
1251-
$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>";
1253+
$teamLabel = StringHelper::xmlEntities($tData["LABEL"]);
1254+
$users.= "<li class='complete_group_entry' data-group='/AJXP_TEAM/$tId' data-label=\"[team] ".$teamLabel."\"><span class='user_entry_label'>[team] ".$teamLabel."</span></li>";
12521255
}
12531256
}
12541257
}
@@ -1263,7 +1266,9 @@ public function switchAction(ServerRequestInterface $requestInterface, ResponseI
12631266
$userDisplay = $userLabel;
12641267
}
12651268
$userIsExternal = $userObject->hasParent() ? "true":"false";
1266-
$users .= "<li class='complete_user_entry' data-external=\"$userIsExternal\" data-label=\"$userLabel\" data-avatar='$userAvatar' data-entry_id='$userId'><span class='user_entry_label'>".$userDisplay."</span></li>";
1269+
$userLabel = StringHelper::xmlEntities($userLabel);
1270+
$userDisplay = StringHelper::xmlEntities($userDisplay);
1271+
$users .= "<li class='complete_user_entry' data-external=\"$userIsExternal\" data-label=\"".$userLabel."\" data-avatar='$userAvatar' data-entry_id='$userId'><span class='user_entry_label'>".$userDisplay."</span></li>";
12671272
$index ++;
12681273
}
12691274
if($index == $limit) break;

0 commit comments

Comments
 (0)