mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-11 01:18:59 +08:00
修复分流解析错误的问题
This commit is contained in:
parent
1398782595
commit
18164a0c7d
@ -2643,13 +2643,15 @@ var RuleUtils = (function () {
|
|||||||
const parse = (raw) => {
|
const parse = (raw) => {
|
||||||
const lines = raw.split("\n");
|
const lines = raw.split("\n");
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
lines[i] = lines[i]
|
let type = lines[i].split(",")[0];
|
||||||
.replace(/host-suffix/i, "DOMAIN-SUFFIX")
|
type = type
|
||||||
.replace(/host-keyword/i, "DOMAIN-KEYWORD")
|
|
||||||
.replace(/host/i, "DOMAIN")
|
.replace(/host/i, "DOMAIN")
|
||||||
|
.replace(/-suffix/, "-SUFFIX")
|
||||||
|
.replace(/-keyword/, "-KEYWORD")
|
||||||
.replace("ip-cidr", "IP-CIDR")
|
.replace("ip-cidr", "IP-CIDR")
|
||||||
.replace(/ip6-cidr/i, "IP-CIDR6")
|
.replace(/ip6-cidr/i, "IP-CIDR6")
|
||||||
.replace("user-agent", "USER-AGENT");
|
.replace("user-agent", "USER-AGENT");
|
||||||
|
lines[i] = type + "," + lines[i].split(",")[1];
|
||||||
}
|
}
|
||||||
return SurgeRuleSet().parse(lines.join("\n"));
|
return SurgeRuleSet().parse(lines.join("\n"));
|
||||||
};
|
};
|
||||||
|
4
backend/sub-store.min.js
vendored
4
backend/sub-store.min.js
vendored
File diff suppressed because one or more lines are too long
@ -2054,13 +2054,15 @@ var RuleUtils = (function () {
|
|||||||
const parse = (raw) => {
|
const parse = (raw) => {
|
||||||
const lines = raw.split("\n");
|
const lines = raw.split("\n");
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
lines[i] = lines[i]
|
let type = lines[i].split(",")[0];
|
||||||
.replace(/host-suffix/i, "DOMAIN-SUFFIX")
|
type = type
|
||||||
.replace(/host-keyword/i, "DOMAIN-KEYWORD")
|
|
||||||
.replace(/host/i, "DOMAIN")
|
.replace(/host/i, "DOMAIN")
|
||||||
|
.replace(/-suffix/, "-SUFFIX")
|
||||||
|
.replace(/-keyword/, "-KEYWORD")
|
||||||
.replace("ip-cidr", "IP-CIDR")
|
.replace("ip-cidr", "IP-CIDR")
|
||||||
.replace(/ip6-cidr/i, "IP-CIDR6")
|
.replace(/ip6-cidr/i, "IP-CIDR6")
|
||||||
.replace("user-agent", "USER-AGENT");
|
.replace("user-agent", "USER-AGENT");
|
||||||
|
lines[i] = type + "," + lines[i].split(",")[1];
|
||||||
}
|
}
|
||||||
return SurgeRuleSet().parse(lines.join("\n"));
|
return SurgeRuleSet().parse(lines.join("\n"));
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user