Fix
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled

https://github.com/2dust/v2rayN/issues/7247
This commit is contained in:
2dust 2025-05-08 15:56:52 +08:00
parent 82b366cd9b
commit 3d462c4be3

View file

@ -1088,14 +1088,11 @@ public class CoreConfigSingboxService
if (item.Port.IsNotEmpty())
{
if (item.Port.Contains("-"))
{
rule.port_range = new List<string> { item.Port.Replace("-", ":") };
}
else
{
rule.port = new List<int> { item.Port.ToInt() };
}
var portRanges = item.Port.Split(',').Where(it => it.Contains('-')).Select(it => it.Replace("-", ":")).ToList();
var ports = item.Port.Split(',').Where(it => !it.Contains('-')).Select(it => it.ToInt()).ToList();
rule.port_range = portRanges.Count > 0 ? portRanges : null;
rule.port = ports.Count > 0 ? ports : null;
}
if (item.Network.IsNotEmpty())
{