mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 11:43:09 +02:00
Fix bug
This commit is contained in:
parent
e5409db0e8
commit
a6befdd541
1 changed files with 12 additions and 10 deletions
|
@ -53,16 +53,18 @@ export default define(meta, async (ps) => {
|
||||||
if (blackDomains.length > 0) {
|
if (blackDomains.length > 0) {
|
||||||
query.andWhere(new Brackets(qb => {
|
query.andWhere(new Brackets(qb => {
|
||||||
for (const blackDomain of blackDomains) {
|
for (const blackDomain of blackDomains) {
|
||||||
const subDomains = blackDomain.split('.');
|
qb.andWhere(new Brackets(qb => {
|
||||||
let i = 0;
|
const subDomains = blackDomain.split('.');
|
||||||
for (const subDomain of subDomains) {
|
let i = 0;
|
||||||
const p = `blackSubDomain_${subDomain}_${i}`;
|
for (const subDomain of subDomains) {
|
||||||
// 全体で否定できないのでド・モルガンの法則で
|
const p = `blackSubDomain_${subDomain}_${i}`;
|
||||||
// !(P && Q) を !P || !Q で表す
|
// 全体で否定できないのでド・モルガンの法則で
|
||||||
// SQL is 1 based, so we need '+ 1'
|
// !(P && Q) を !P || !Q で表す
|
||||||
qb.orWhere(`log.domain[${i + 1}] != :${p}`, { [p]: subDomain });
|
// SQL is 1 based, so we need '+ 1'
|
||||||
i++;
|
qb.orWhere(`log.domain[${i + 1}] != :${p}`, { [p]: subDomain });
|
||||||
}
|
i++;
|
||||||
|
}
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue