escape username in users table

pull/11269/head
mehmet-erim 4 years ago
parent fdbe73d04a
commit 520ac76022

@ -23,5 +23,8 @@ export function interpolate(text: string, params: string[]) {
} }
export function escapeHtmlChars(value: string) { export function escapeHtmlChars(value: string) {
return value && value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;'); return (
value &&
value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
);
} }

@ -1,4 +1,4 @@
import { LocalizationService } from '@abp/ng.core'; import { escapeHtmlChars, LocalizationService } from '@abp/ng.core';
import { IdentityUserDto } from '@abp/ng.identity/proxy'; import { IdentityUserDto } from '@abp/ng.identity/proxy';
import { EntityProp, ePropType } from '@abp/ng.theme.shared/extensions'; import { EntityProp, ePropType } from '@abp/ng.theme.shared/extensions';
import { of } from 'rxjs'; import { of } from 'rxjs';
@ -21,7 +21,9 @@ export const DEFAULT_USERS_ENTITY_PROPS = EntityProp.createMany<IdentityUserDto>
return of( return of(
` `
${!data.record.isActive ? inactiveIcon : ''} ${!data.record.isActive ? inactiveIcon : ''}
<span class="${!data.record.isActive ? 'text-muted' : ''}">${data.record.userName}</span>`, <span class="${!data.record.isActive ? 'text-muted' : ''}">${escapeHtmlChars(
data.record.userName,
)}</span>`,
); );
}, },
}, },

Loading…
Cancel
Save