diff --git a/DirectPackageInstaller/DirectPackageInstaller/Others/Extensions.cs b/DirectPackageInstaller/DirectPackageInstaller/Others/Extensions.cs index 0affd4a..71da729 100644 --- a/DirectPackageInstaller/DirectPackageInstaller/Others/Extensions.cs +++ b/DirectPackageInstaller/DirectPackageInstaller/Others/Extensions.cs @@ -8,6 +8,7 @@ using System.Net; using System.Reflection; using System.Runtime.InteropServices; +using System.Text.Encodings.Web; using System.Threading; using System.Threading.Tasks; using Avalonia.Controls; @@ -97,8 +98,17 @@ void DialogClosed(object sender, EventArgs e) public static bool IsValidURL(this string URL) { - var Escaped = URL.Replace("[", "%5B").Replace("]", "%5D"); - return Uri.IsWellFormedUriString(Escaped, UriKind.Absolute); + var Escaped = URL + .Replace("[", "%5B") + .Replace("]", "%5D"); + try + { + return new Uri(Escaped).IsAbsoluteUri; + } + catch + { + return false; + } } public static bool HasName(this ParamSfo This, string name) {