Fixes
This commit is contained in:
parent
6e0f27f254
commit
c54915e940
|
@ -871,6 +871,8 @@ Channel.prototype.handleBanAllIP = function (actor, name, reason, range) {
|
||||||
* Bans an individual IP
|
* Bans an individual IP
|
||||||
*/
|
*/
|
||||||
Channel.prototype.banIP = function (actor, ip, name, reason, range) {
|
Channel.prototype.banIP = function (actor, ip, name, reason, range) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
if (range) {
|
if (range) {
|
||||||
ip = ip.replace(/(\d+)\.(\d+)\.(\d+)\.(\d+)/, "$1.$2.$3");
|
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;
|
const tag_re = /<\s*\/?\s*([a-z]+)(\s*([a-z]+)\s*=\s*('[^']*'|"[^"]*"|[^"'>]*))*\s*>/ig;
|
||||||
|
|
||||||
function filter(str) {
|
function filter(str) {
|
||||||
|
if (typeof str !== "string") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
str = str.replace(tag_re, function (match, tag) {
|
str = str.replace(tag_re, function (match, tag) {
|
||||||
if(!~allowed.indexOf(tag.toLowerCase())) {
|
if(!~allowed.indexOf(tag.toLowerCase())) {
|
||||||
return match.replace("<", "<").replace(">", ">");
|
return match.replace("<", "<").replace(">", ">");
|
||||||
|
@ -11,7 +15,8 @@ function filter(str) {
|
||||||
str = str.replace(/(\bon\w*\s*=\s*('[^']*'|"[^"]"|[^\s><]*))/ig, function () {
|
str = str.replace(/(\bon\w*\s*=\s*('[^']*'|"[^"]"|[^\s><]*))/ig, function () {
|
||||||
return "";
|
return "";
|
||||||
});
|
});
|
||||||
return str;
|
|
||||||
|
return str.substring(0, 20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.filter = filter;
|
exports.filter = filter;
|
||||||
|
|
|
@ -690,3 +690,5 @@ $("#userlisttoggle").click(toggleUserlist);
|
||||||
$(".add-temp").change(function () {
|
$(".add-temp").change(function () {
|
||||||
$(".add-temp").prop("checked", $(this).prop("checked"));
|
$(".add-temp").prop("checked", $(this).prop("checked"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
applyOpts();
|
||||||
|
|
|
@ -719,8 +719,6 @@ function applyOpts() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
applyOpts();
|
|
||||||
|
|
||||||
function showPollMenu() {
|
function showPollMenu() {
|
||||||
$("#pollwrap .poll-menu").remove();
|
$("#pollwrap .poll-menu").remove();
|
||||||
var menu = $("<div/>").addClass("well poll-menu")
|
var menu = $("<div/>").addClass("well poll-menu")
|
||||||
|
|
|
@ -11,14 +11,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("cookie theme=", theme);
|
||||||
|
|
||||||
if (theme !== "default") {
|
if (theme !== "default") {
|
||||||
var cur = document.getElementById("usertheme");
|
var cur = document.getElementById("usertheme");
|
||||||
cur.parentNode.removeChild(cur);
|
cur.parentNode.removeChild(cur);
|
||||||
|
console.log('removed');
|
||||||
var css = document.createElement("link");
|
var css = document.createElement("link");
|
||||||
css.setAttribute("rel", "stylesheet");
|
css.setAttribute("rel", "stylesheet");
|
||||||
css.setAttribute("type", "text/css");
|
css.setAttribute("type", "text/css");
|
||||||
css.setAttribute("href", theme);
|
css.setAttribute("href", theme);
|
||||||
css.setAttribute("id", "usertheme");
|
css.setAttribute("id", "usertheme");
|
||||||
document.head.appendChild(css);
|
document.head.appendChild(css);
|
||||||
|
console.log(css);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue