Fixes
This commit is contained in:
parent
6e0f27f254
commit
c54915e940
5 changed files with 14 additions and 3 deletions
|
|
@ -871,6 +871,8 @@ Channel.prototype.handleBanAllIP = function (actor, name, reason, range) {
|
|||
* Bans an individual IP
|
||||
*/
|
||||
Channel.prototype.banIP = function (actor, ip, name, reason, range) {
|
||||
var self = this;
|
||||
|
||||
if (range) {
|
||||
ip = ip.replace(/(\d+)\.(\d+)\.(\d+)\.(\d+)/, "$1.$2.$3");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,10 @@ const allowed = ["iframe", "object", "param", "embed"];
|
|||
const tag_re = /<\s*\/?\s*([a-z]+)(\s*([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^"'>]*))*\s*>/ig;
|
||||
|
||||
function filter(str) {
|
||||
if (typeof str !== "string") {
|
||||
return "";
|
||||
}
|
||||
|
||||
str = str.replace(tag_re, function (match, tag) {
|
||||
if(!~allowed.indexOf(tag.toLowerCase())) {
|
||||
return match.replace("<", "<").replace(">", ">");
|
||||
|
|
@ -11,7 +15,8 @@ function filter(str) {
|
|||
str = str.replace(/(\bon\w*\s*=\s*('[^']*'|"[^"]"|[^\s><]*))/ig, function () {
|
||||
return "";
|
||||
});
|
||||
return str;
|
||||
|
||||
return str.substring(0, 20000);
|
||||
}
|
||||
|
||||
exports.filter = filter;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue