fix critical and high severity security vulnerabilities (#3060)
This commit is contained in:
+1
-1
@@ -670,7 +670,7 @@
|
||||
</div>
|
||||
<div class="description-body">
|
||||
<div #descriptionContent [ngClass]="{ 'line-clamp-7': !isExpanded }" class="description-content">
|
||||
<div class="description-html" [innerHTML]="book.metadata!.description"></div>
|
||||
<div class="description-html" [innerHTML]="sanitizeDescription(book.metadata!.description)"></div>
|
||||
</div>
|
||||
@if (isExpanded || isOverflowing) {
|
||||
<button class="expand-toggle" (click)="toggleExpand()">
|
||||
|
||||
+5
@@ -38,6 +38,7 @@ import {TranslocoDirective, TranslocoPipe, TranslocoService} from '@jsverse/tran
|
||||
import {AuthorService} from '../../../../author-browser/service/author.service';
|
||||
import {Dialog} from 'primeng/dialog';
|
||||
import {Checkbox} from 'primeng/checkbox';
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -490,6 +491,10 @@ export class MetadataViewerComponent implements OnInit, OnChanges, AfterViewChec
|
||||
this.isExpanded = !this.isExpanded;
|
||||
}
|
||||
|
||||
sanitizeDescription(html: string | null | undefined): string {
|
||||
return html ? DOMPurify.sanitize(html) : '';
|
||||
}
|
||||
|
||||
read(bookId: number | undefined, reader?: "epub-streaming", bookType?: BookType): void {
|
||||
if (bookId) this.bookService.readBook(bookId, reader, bookType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user