mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-04-19 12:57:17 +00:00
fix: sanitize message in notification component (#2664)
fix: sanitize messages in notification component
This commit is contained in:
parent
9ab87bf8b5
commit
d298b3ffc9
@ -2,6 +2,7 @@ import React from '@theia/core/shared/react';
|
||||
import { NotificationComponent as TheiaNotificationComponent } from '@theia/messages/lib/browser/notification-component';
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import { codicon } from '@theia/core/lib/browser';
|
||||
import { sanitize } from 'dompurify';
|
||||
|
||||
export class NotificationComponent extends TheiaNotificationComponent {
|
||||
override render(): React.ReactNode {
|
||||
@ -20,7 +21,7 @@ export class NotificationComponent extends TheiaNotificationComponent {
|
||||
/>
|
||||
<div className="theia-notification-message">
|
||||
<span
|
||||
dangerouslySetInnerHTML={{ __html: message }}
|
||||
dangerouslySetInnerHTML={{ __html: sanitize(message) }}
|
||||
onClick={this.onMessageClick}
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user