Added: sanitize check for Emoji

This commit is contained in:
DuckieTM 2024-03-24 18:27:56 +01:00
parent ae267e9430
commit 10b0591e0b
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@
"@emoji-mart/react": "^1.1.1",
"@nitrots/nitro-renderer": "file:submodules/renderer",
"@tanstack/react-virtual": "^3.0.0-beta.60",
"dompurify": "^3.0.9",
"dompurify": "^3.0.11",
"emoji-mart": "^5.5.2",
"emoji-toolkit": "8.0.0",
"react": "^18.2.0",

View File

@ -79,7 +79,7 @@ export const ChatWidgetMessageView: FC<ChatWidgetMessageViewProps> = props => {
return (
<div ref={elementRef} className={`bubble-container newbubblehe ${isVisible ? 'visible' : 'invisible'}`} onClick={event => GetRoomEngine().selectRoomObject(chat.roomId, chat.senderId, RoomObjectCategory.UNIT)}>
{selectedEmoji && <span>{selectedEmoji}</span>}
{selectedEmoji && <span>{DOMPurify.sanitize(selectedEmoji)}</span>}
{ (chat.styleId === 0) &&
<div className="user-container-bg" style={ { backgroundColor: chat.color } } /> }
<div className={ `chat-bubble bubble-${ chat.styleId } type-${ chat.type }` } style={ { maxWidth: getBubbleWidth } }>