Skip to content

Commit d298b3f

Browse files
authored
fix: sanitize message in notification component (#2664)
fix: sanitize messages in notification component
1 parent 9ab87bf commit d298b3f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arduino-ide-extension/src/browser/theia/messages/notification-component.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from '@theia/core/shared/react';
22
import { NotificationComponent as TheiaNotificationComponent } from '@theia/messages/lib/browser/notification-component';
33
import { nls } from '@theia/core/lib/common';
44
import { codicon } from '@theia/core/lib/browser';
5+
import { sanitize } from 'dompurify';
56

67
export class NotificationComponent extends TheiaNotificationComponent {
78
override render(): React.ReactNode {
@@ -20,7 +21,7 @@ export class NotificationComponent extends TheiaNotificationComponent {
2021
/>
2122
<div className="theia-notification-message">
2223
<span
23-
dangerouslySetInnerHTML={{ __html: message }}
24+
dangerouslySetInnerHTML={{ __html: sanitize(message) }}
2425
onClick={this.onMessageClick}
2526
/>
2627
</div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy