Comments (7)
from chatify-demo.
If the system is already right, only when it parses from append input to chat it has an xss bug
from chatify-demo.
Hi @Jieyab89 ,
I'll check this issue and fix it ASAP.
Thanks a lot for your efforts to make this package better.
from chatify-demo.
Solved, im fix xss in chat message, im create function for encoding
//create like htmlspecialchars in js
function escapeHtml(text) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
from chatify-demo.
in file code.js
from chatify-demo.
Create function htmlescape in code.js
Code :
//create like htmlspecialchars in js
function escapeHtml(text) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
after you create the function you can call it, and call the function as needed,
For example, I called the htmlescape function in the message text area. You can check this
Example :
//create like htmlspecialchars in js
function escapeHtml(text) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
}
// While sending a message, show this temporary message card.
function sendigCard(message, id) {
const body = escapeHtml(message);
return <div class="message-card mc-sender" data-id="
+ id + "> <p>
+ body + <sub><span class="far fa-clock"></span></sub></p> </div>
;
}
from chatify-demo.
Thank you munafio
from chatify-demo.
Related Issues (20)
- Edit the Message Controller getContacts HOT 11
- Target class [MessagesController] does not exist. HOT 3
- Can i use it with octobercms?
- "No internet access" when install and run this. HOT 1
- can i use this in shared hosting HOT 1
- Display issue with Demo HOT 1
- Link is not clickable HOT 1
- Why can't you see the history list? HOT 2
- so slow HOT 3
- Does not work with Laravel 9 HOT 1
- Can't see chat box or favorite chat user HOT 2
- Getting error like 'No internet access' & Always reload page is required HOT 1
- Does not display users in "All Messages" HOT 1
- Login Error HOT 1
- changing user profile from avatar HOT 1
- doesn't support php 8.3 HOT 1
- Does not display users avatar.
- javascript not load i.e chatify:329 Uncaught ReferenceError: $ is not defined at chatify:329 HOT 1
- After Send message receiver need to reload page!! pusher not working properly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatify-demo.