Fixed a bug in parsing subscription result
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run

https://github.com/2dust/v2rayN/issues/7734
This commit is contained in:
2dust 2025-08-16 20:05:56 +08:00
parent 186b56aed9
commit 120e8d0686
3 changed files with 17 additions and 8 deletions

View file

@ -1412,6 +1412,11 @@ public class ConfigHandler
{
profileItem = V2rayFmt.ResolveFull(strData, subRemarks);
}
//Is Html Page
if (profileItem is null && HtmlPageFmt.IsHtmlPage(strData))
{
return -1;
}
//Is Clash configuration
if (profileItem is null)
{

View file

@ -220,14 +220,7 @@ public class BaseFmt
protected static bool Contains(string str, params string[] s)
{
foreach (var item in s)
{
if (str.Contains(item, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
return s.All(item => str.Contains(item, StringComparison.OrdinalIgnoreCase));
}
protected static string WriteAllText(string strData, string ext = "json")

View file

@ -0,0 +1,11 @@
using SkiaSharp;
namespace ServiceLib.Handler.Fmt;
public class HtmlPageFmt : BaseFmt
{
public static bool IsHtmlPage(string strData)
{
return Contains(strData, "<html", "<!doctype html", "<head");
}
}