core: also check lang limit of current domain

This commit is contained in:
undefined committed 2022-02-10 17:16:26 +08:00
1 parent 28935b5477
commit 16b9cb461e
2 files changed
+7 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.4.16", "version": "3.4.17",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",
+6 -4
View File
@@ -310,10 +310,12 @@ export class ProblemDetailHandler extends ProblemHandler {
this.pdoc.config = pdoc.config; this.pdoc.config = pdoc.config;
} }
if (ddoc.langs && typeof this.pdoc.config !== 'string') { if (ddoc.langs && typeof this.pdoc.config !== 'string') {
this.pdoc.config.langs = intersection( const dl = ddoc.langs.split(',').map((i) => i.trim()).filter((i) => i);
this.pdoc.config.langs || ddoc.langs.split(','), this.pdoc.config.langs = intersection(this.pdoc.config.langs || dl, dl);
ddoc.langs.split(','), }
); if (this.domain.langs && typeof this.pdoc.config !== 'string') {
const dl = this.domain.langs.split(',').map((i) => i.trim()).filter((i) => i);
this.pdoc.config.langs = intersection(this.pdoc.config.langs || dl, dl);
} }
await bus.serial('problem/get', this.pdoc, this); await bus.serial('problem/get', this.pdoc, this);
[this.psdoc, this.udoc] = await Promise.all([ [this.psdoc, this.udoc] = await Promise.all([