mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-17 14:21:14 +00:00
[ACS-10116] [ACA] Search page renders HTML from the Description,Title field instead of showing it as plain text
This commit is contained in:
@@ -29,6 +29,7 @@ import { first } from 'rxjs/operators';
|
|||||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||||
import { SearchResultsRowComponent } from './search-results-row.component';
|
import { SearchResultsRowComponent } from './search-results-row.component';
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
|
import { ResultNode } from '@alfresco/js-api/typings';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-datatable-cell-badges',
|
selector: 'aca-datatable-cell-badges',
|
||||||
@@ -241,7 +242,7 @@ describe('SearchResultsRowComponent', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function createMaliciousEntry(overrides: any): ResultSetRowEntry {
|
function createMaliciousEntry(overrides: Partial<ResultNode>): ResultSetRowEntry {
|
||||||
return {
|
return {
|
||||||
entry: {
|
entry: {
|
||||||
id: 'test-entry',
|
id: 'test-entry',
|
||||||
|
@@ -47,14 +47,6 @@ import { DomSanitizer } from '@angular/platform-browser';
|
|||||||
host: { class: 'aca-search-results-row' }
|
host: { class: 'aca-search-results-row' }
|
||||||
})
|
})
|
||||||
export class SearchResultsRowComponent implements OnInit {
|
export class SearchResultsRowComponent implements OnInit {
|
||||||
private settings = inject(AppSettingsService);
|
|
||||||
private readonly sanitizer = inject(DomSanitizer);
|
|
||||||
|
|
||||||
private readonly highlightPrefix = "<span class='aca-highlight'>";
|
|
||||||
private readonly highlightPostfix = '</span>';
|
|
||||||
|
|
||||||
private node: NodeEntry;
|
|
||||||
|
|
||||||
@Input({ required: true })
|
@Input({ required: true })
|
||||||
context: any;
|
context: any;
|
||||||
|
|
||||||
@@ -68,7 +60,13 @@ export class SearchResultsRowComponent implements OnInit {
|
|||||||
contentStripped = '';
|
contentStripped = '';
|
||||||
isFile = false;
|
isFile = false;
|
||||||
|
|
||||||
|
private settings = inject(AppSettingsService);
|
||||||
|
private node: NodeEntry;
|
||||||
|
|
||||||
private readonly destroyRef = inject(DestroyRef);
|
private readonly destroyRef = inject(DestroyRef);
|
||||||
|
private readonly sanitizer = inject(DomSanitizer);
|
||||||
|
private readonly highlightPrefix = "<span class='aca-highlight'>";
|
||||||
|
private readonly highlightPostfix = '</span>';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
@@ -135,8 +133,6 @@ export class SearchResultsRowComponent implements OnInit {
|
|||||||
if (title !== name) {
|
if (title !== name) {
|
||||||
const sanitizedTitle = this.sanitizer.sanitize(SecurityContext.HTML, title);
|
const sanitizedTitle = this.sanitizer.sanitize(SecurityContext.HTML, title);
|
||||||
this.title$.next(sanitizedTitle ? ` ( ${sanitizedTitle} )` : '');
|
this.title$.next(sanitizedTitle ? ` ( ${sanitizedTitle} )` : '');
|
||||||
this.title$.next(title ? ` ( ${title} )` : '');
|
|
||||||
this.titleStripped = this.stripHighlighting(title);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user