-
Notifications
You must be signed in to change notification settings - Fork 906
Emoji Replacer Widget #2590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emoji Replacer Widget #2590
Conversation
|
👋 Unassigning @wiz0floyd due to inactivity (> 60 min without comments/reviews). This PR remains open for other reviewers. |
SapphicFire
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Be very careful when trusting user input, as this can be used maliciously.
| var regex = new RegExp(key.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1"),'g'); | ||
| text = text.replace(regex,c.emojiMap[key]); | ||
| } | ||
| c.outputText= $sce.trustAsHtml(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use of $sce.trustAsHtml() gives explicit trust to the input and makes this widget vulnerable - using the below input will allow XSS:
<script>alert("XSS");</script>. I'll create an issue and quickly resolve this in a follow up
PR Description:
This widget enhances the user experience by automatically converting emojis code into visual emojis while typing - adding personality and clarity to text communication.
Pull Request Checklist
Overview
Code Quality
Repository Structure Compliance
Core ServiceNow APIs/Server-Side Components/Client-Side Components/Modern Development/Integration/Specialized Areas/Documentation
Restrictions