1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-12 09:55:53 +00:00
This commit is contained in:
Ranjiwei 2025-03-17 15:51:39 +08:00 committed by GitHub
parent feab625130
commit 24c7b0da74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 10 deletions
frontend/src
components/common
pages
dashboard
sys-admin/admin-logs

View File

@ -37,14 +37,13 @@ class NoticeItem extends React.Component {
let groupStaff = detail.group_staff_name;
// group name does not support special characters
let userHref = siteRoot + 'profile/' + detail.group_staff_email + '/';
let userHref = siteRoot + 'profile/' + encodeURIComponent(detail.group_staff_email) + '/';
let groupHref = siteRoot + 'group/' + detail.group_id + '/';
let groupName = detail.group_name;
let notice = gettext('User {user_link} has added you to {group_link}');
let userLink = '<a href=' + userHref + '>' + groupStaff + '</a>';
let groupLink = '<a href=' + groupHref + '>' + groupName + '</a>';
let userLink = '<a href=' + userHref + '>' + Utils.HTMLescape(groupStaff) + '</a>';
let groupLink = '<a href=' + groupHref + '>' + Utils.HTMLescape(groupName) + '</a>';
notice = notice.replace('{user_link}', userLink);
notice = notice.replace('{group_link}', groupLink);

View File

@ -72,7 +72,7 @@ class ActivityItem extends Component {
}
} else if (item.obj_type == 'files') {
let fileURL = `${siteRoot}lib/${item.repo_id}/file${Utils.encodePath(item.path)}`;
let fileLink = `<a href=${fileURL} target="_blank">${item.name}</a>`;
let fileLink = `<a href=${fileURL} target="_blank">${Utils.HTMLescape(item.name)}</a>`;
let fileCount = item.createdFilesCount - 1;
let firstLine = gettext('{file} and {n} other files')
.replace('{file}', fileLink)

View File

@ -136,15 +136,15 @@ class Item extends Component {
detailText = gettext('Created library {library_name} with {owner} as its owner')
.replace('{owner}', '<a href="' + ownerPageUrl + '">' + detail.owner + '</a>');
if (isPro && enableSysAdminViewRepo) {
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + detail.name + '</a>');
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + Utils.HTMLescape(detail.name) + '</a>');
} else {
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + detail.name + '</span>');
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + Utils.HTMLescape(detail.name) + '</span>');
}
return detailText;
case 'repo_delete':
detailText = gettext('Deleted library {library_name}')
.replace('{library_name}', '<span class="font-weight-bold">' + detail.name + '</span>');
.replace('{library_name}', '<span class="font-weight-bold">' + Utils.HTMLescape(detail.name) + '</span>');
return detailText;
case 'repo_transfer':
@ -152,9 +152,9 @@ class Item extends Component {
.replace('{user_from}', '<span class="font-weight-bold">' + detail.from + '</span>')
.replace('{user_to}', '<span class="font-weight-bold">' + detail.to+ '</span>');
if (isPro && enableSysAdminViewRepo) {
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + detail.name + '</a>');
detailText = detailText.replace('{library_name}', '<a href="' + repoPageUrl + '">' + Utils.HTMLescape(detail.name) + '</a>');
} else {
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + detail.name + '</span>');
detailText = detailText.replace('{library_name}', '<span class="font-weight-bold">' + Utils.HTMLescape(detail.name) + '</span>');
}
return detailText;