mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use url host
This commit is contained in:
parent
bdb3616977
commit
8e6a410cfc
2 changed files with 16 additions and 10 deletions
|
|
@ -268,13 +268,16 @@ public static class PluginInstallationHelper
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var author = pieces[3];
|
var author = pieces[3];
|
||||||
|
var acceptedHost = "github.com";
|
||||||
var acceptedSource = "https://github.com";
|
var acceptedSource = "https://github.com";
|
||||||
var constructedUrlPart = string.Format("{0}/{1}/", acceptedSource, author);
|
var constructedUrlPart = string.Format("{0}/{1}/", acceptedSource, author);
|
||||||
|
|
||||||
return url.StartsWith(acceptedSource) &&
|
if (!Uri.TryCreate(url, UriKind.Absolute, out var uri) || uri.Host != acceptedHost)
|
||||||
App.API.GetAllPlugins().Any(x =>
|
return false;
|
||||||
!string.IsNullOrEmpty(x.Metadata.Website) &&
|
|
||||||
x.Metadata.Website.StartsWith(constructedUrlPart)
|
return App.API.GetAllPlugins().Any(x =>
|
||||||
);
|
!string.IsNullOrEmpty(x.Metadata.Website) &&
|
||||||
|
x.Metadata.Website.StartsWith(constructedUrlPart)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -626,14 +626,17 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var author = pieces[3];
|
var author = pieces[3];
|
||||||
|
var acceptedHost = "github.com";
|
||||||
var acceptedSource = "https://github.com";
|
var acceptedSource = "https://github.com";
|
||||||
var constructedUrlPart = string.Format("{0}/{1}/", acceptedSource, author);
|
var constructedUrlPart = string.Format("{0}/{1}/", acceptedSource, author);
|
||||||
|
|
||||||
return url.StartsWith(acceptedSource) &&
|
if (!Uri.TryCreate(url, UriKind.Absolute, out var uri) || uri.Host != acceptedHost)
|
||||||
Context.API.GetAllPlugins().Any(x =>
|
return false;
|
||||||
!string.IsNullOrEmpty(x.Metadata.Website) &&
|
|
||||||
x.Metadata.Website.StartsWith(constructedUrlPart)
|
return Context.API.GetAllPlugins().Any(x =>
|
||||||
);
|
!string.IsNullOrEmpty(x.Metadata.Website) &&
|
||||||
|
x.Metadata.Website.StartsWith(constructedUrlPart)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async ValueTask<List<Result>> RequestInstallOrUpdateAsync(string search, CancellationToken token,
|
internal async ValueTask<List<Result>> RequestInstallOrUpdateAsync(string search, CancellationToken token,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue