diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 2349ab14d..a3e9de4b8 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -114,7 +114,10 @@ namespace Flow.Launcher.Infrastructure.Image { return new ImageResult(ImageCache[path], ImageType.Cache); } - if (path.StartsWith("http://") || path.StartsWith("https://")) + Uri uriResult; + bool IsUriScheme = Uri.TryCreate(path, UriKind.Absolute, out uriResult) + && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps); + if (IsUriScheme) { // Download image from url using (WebClient client = new WebClient()) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 1fcfd8858..c784d60e0 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -130,8 +130,11 @@ namespace Flow.Launcher.Plugin get { return _pluginDirectory; } set { + Uri uriResult; + bool IsUriScheme = Uri.TryCreate(IcoPath, UriKind.Absolute, out uriResult) + && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps); _pluginDirectory = value; - if (!string.IsNullOrEmpty(IcoPath) && !Path.IsPathRooted(IcoPath) && !IcoPath.StartsWith("http://") && !IcoPath.StartsWith("https://")) + if (!string.IsNullOrEmpty(IcoPath) && !Path.IsPathRooted(IcoPath) && !IsUriScheme) { IcoPath = Path.Combine(value, IcoPath); }