Commit b59cd0f8 authored by Rigel Kent's avatar Rigel Kent
Browse files

Merge branch 'grin-main-patch-30252' into 'main'

Fixing lot of syntax and undef-check errors

See merge request !1
parents d961a56b 093b938c
......@@ -75,8 +75,9 @@ async function filterRegistration(result, params, settingsManager) {
await settingsManager.getSetting("registration-blocked-email-right")
)
.replace(/\s/g, "")
.split(",")
if (mm.isMatch(params.body.email.split("@")[1], blockedEmailRight))
.split(",");
if(params.body)
if (mm.isMatch(params.body.email.split("@")[1], blockedEmailRight))
return { allowed: false }
// check left part of the mail address for forbidden username, if any
......@@ -84,8 +85,9 @@ async function filterRegistration(result, params, settingsManager) {
await settingsManager.getSetting("registration-blocked-email-left")
)
.replace(/\s/g, "")
.split(",")
if (mm.isMatch(params.body.email.split("@")[0], blockedEmailLeft))
.split(",");
if(params.body)
if (mm.isMatch(params.body.email.split("@")[0], blockedEmailLeft))
return { allowed: false }
// check IP against known blacklists, if any
......@@ -96,7 +98,7 @@ async function filterRegistration(result, params, settingsManager) {
const res = await dnsbl.batch(
[params.ip],
[blacklists.replace(/\s/g, "").split(",")]
)
);
if (res.find(ip => ip.listed)) return { allowed: false }
}
......@@ -110,7 +112,7 @@ async function autoblacklistVideos(result, params, settingsManager) {
const videoRules = (await settingsManager.getSetting("video-autoblacklist"))
.replace(/\s/g, "")
.split(",")
.split(",");
[
"name",
"description",
......@@ -130,6 +132,6 @@ async function autohideThreads(result, params, settingsManager) {
const commentRules = (await settingsManager.getSetting("comment-autohide"))
.relpace(/\s/g, "")
.split(",")
.split(",");
if (mm.contains(params.thread.comment, commentRules)) return { allowed: false }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment