mirror of https://github.com/calzoneman/sync.git
Fix emote regex due to sanitize-html changes
This commit is contained in:
parent
9239c2d465
commit
f6500ff745
|
@ -2,7 +2,7 @@
|
|||
"author": "Calvin Montgomery",
|
||||
"name": "CyTube",
|
||||
"description": "Online media synchronizer and chat",
|
||||
"version": "3.34.0",
|
||||
"version": "3.34.1",
|
||||
"repository": {
|
||||
"url": "http://github.com/calzoneman/sync"
|
||||
},
|
||||
|
|
|
@ -75,7 +75,7 @@ function validateEmote(f) {
|
|||
f.image = f.image.substring(0, 1000);
|
||||
f.image = XSS.sanitizeText(f.image);
|
||||
|
||||
var s = XSS.sanitizeText(f.name).replace(/([\\\.\?\+\*\$\^\|\(\)\[\]\{\}])/g, "\\$1");
|
||||
var s = XSS.looseSanitizeText(f.name).replace(/([\\\.\?\+\*\$\^\|\(\)\[\]\{\}])/g, "\\$1");
|
||||
s = "(^|\\s)" + s + "(?!\\S)";
|
||||
f.source = s;
|
||||
|
||||
|
|
|
@ -70,6 +70,14 @@ const SETTINGS = {
|
|||
allowedAttributes: ATTRIBUTE_MAP
|
||||
};
|
||||
|
||||
function looseSanitizeText(str) {
|
||||
str = str.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
return str;
|
||||
}
|
||||
|
||||
function sanitizeText(str) {
|
||||
str = str.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
|
@ -99,5 +107,6 @@ module.exports.sanitizeHTML = function (html) {
|
|||
return sanitizeHTML(html, SETTINGS);
|
||||
};
|
||||
|
||||
module.exports.looseSanitizeText = looseSanitizeText;
|
||||
module.exports.sanitizeText = sanitizeText;
|
||||
module.exports.decodeText = decodeText;
|
||||
|
|
Loading…
Reference in New Issue