mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-28 12:22:37 +00:00
fix singbox parser bug.(#4)
This commit is contained in:
@@ -2709,8 +2709,13 @@ void explodeSub(std::string sub, std::vector<Proxy> &nodes) {
|
||||
throw;
|
||||
}
|
||||
try {
|
||||
std::string pattern = "\"?(inbounds)\"?:";
|
||||
if (!processed &&
|
||||
regFind(sub, "^(?=.*(\"?(inbounds)\"?:))(?=.*(\"?(outbounds)\"?:))(?=.*(\"?(route)\"?:)).*")) {
|
||||
regFind(sub, pattern)) {
|
||||
pattern = "\"?(outbounds)\"?:";
|
||||
if (regFind(sub, pattern)) {
|
||||
pattern = "\"?(route)\"?:";
|
||||
if (regFind(sub, pattern)) {
|
||||
rapidjson::Document document;
|
||||
document.Parse(sub.c_str());
|
||||
if (!document.HasParseError() || document.IsObject()) {
|
||||
@@ -2722,6 +2727,8 @@ void explodeSub(std::string sub, std::vector<Proxy> &nodes) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception &e) {
|
||||
writeLog(LOG_TYPE_ERROR, e.what(), LOG_LEVEL_ERROR);
|
||||
//writeLog(0, e.what(), LOG_LEVEL_DEBUG);
|
||||
|
||||
Reference in New Issue
Block a user