adjust some field check logic

This commit is contained in:
Shawn
2022-07-20 12:07:15 +08:00
parent f349a79365
commit 488fb54a20

View File

@@ -1,5 +1,5 @@
/** /**
☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-19 09:10⟧ ☑️ 资源解析器 ©𝐒𝐡𝐚𝐰𝐧 ⟦2022-07-20 12:00⟧
---------------------------------------------------------- ----------------------------------------------------------
🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot 🛠 发现 𝐁𝐔𝐆 请反馈: https://t.me/Shawn_Parser_Bot
⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API ⛳️ 关注 🆃🅶 相关频道: https://t.me/QuanX_API
@@ -570,14 +570,16 @@ function Type_Check(subs) {
type = (typeQ == "unsupported" || typeQ =="server")? "Clash":"wrong-field"; type = (typeQ == "unsupported" || typeQ =="server")? "Clash":"wrong-field";
typec = "server" typec = "server"
content0 = Clash2QX(subs) content0 = Clash2QX(subs)
} else if ((/^hostname\s*\=|pattern\=/.test(subi) || RewriteK.some(RewriteCheck)) && !/\[(Proxy|filter_local)\]/.test(subs) && para1.indexOf("dst=filter")==-1 && subi.indexOf("securehostname") == -1 && !/module|nodes|rule/.test(typeU) ) { } else if ((/^hostname\s*\=|pattern\=/.test(subi) || RewriteK.some(RewriteCheck)) && para1.indexOf("dst=filter")==-1 && subi.indexOf("securehostname") == -1 && !/module|nodes|rule/.test(typeU) && !(RuleK.some(RuleCheck) && typeQ == "filter")) {
// 2022-07-20 remove constrain && !/\[(Proxy|filter_local)\]/.test(subs)
typec = "rewrite" typec = "rewrite"
type = (typeQ == "unsupported" || typeQ =="rewrite")? "rewrite":"wrong-field" //Quantumult X 类型 rewrite/ Surge Script/ type = (typeQ == "unsupported" || typeQ =="rewrite")? "rewrite":"wrong-field" //Quantumult X 类型 rewrite/ Surge Script/
} else if ( (((ModuleK.some(RewriteCheck) || para1.indexOf("dst=rewrite") != -1) && (para1.indexOf("dst=filter") == -1) && subs.indexOf("[Proxy]") == -1) || typeU == "module") && typeU != "nodes" && typeU != "rule" && typeQ !="filter") { // Surge 类型 module /rule-set(含url-regex) 类型 } else if ( (((ModuleK.some(RewriteCheck) || para1.indexOf("dst=rewrite") != -1) && (para1.indexOf("dst=filter") == -1) && subs.indexOf("[Proxy]") == -1) || typeU == "module") && typeU != "nodes" && typeU != "rule" && typeQ !="filter") { // Surge 类型 module /rule-set(含url-regex) 类型
typec="rewrite" typec="rewrite"
type = (typeQ == "unsupported" || typeQ =="rewrite")? "sgmodule" : "wrong-field" type = (typeQ == "unsupported" || typeQ =="rewrite")? "sgmodule" : "wrong-field"
} else if (((RuleK.some(RuleCheck) && subs.indexOf(html) == -1 && !/\[(Proxy|server_local)\]/.test(subs)) || typeU == "rule" || para1.indexOf("dst=filter")!=-1) && typeU != "nodes" && !(typeQ == "server" && QuanXK.some(NodeCheck))) { } else if (((RuleK.some(RuleCheck) && subs.indexOf(html) == -1 ) || typeU == "rule" || para1.indexOf("dst=filter")!=-1) && typeU != "nodes" && !(typeQ == "server" && QuanXK.some(NodeCheck))) {
// rule/filter类型 // rule/filter类型
// 2022-07-20 remove constrain && !/\[(Proxy|server_local)\]/.test(subs) adter html
typec = "filter" typec = "filter"
type = (typeQ == "unsupported" || typeQ =="filter")? "Rule":"wrong-field"; type = (typeQ == "unsupported" || typeQ =="filter")? "Rule":"wrong-field";
} else if (typeU == "domain-set") {// 仅限用户指定为 domain-set((DomainK.some(RuleCheck) || typeU == "domain-set") && subs.indexOf("[Proxy]") == -1 && typeU != "nodes") { } else if (typeU == "domain-set") {// 仅限用户指定为 domain-set((DomainK.some(RuleCheck) || typeU == "domain-set") && subs.indexOf("[Proxy]") == -1 && typeU != "nodes") {