File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Plugins/Flow.Launcher.Plugin.PluginsManager Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -268,13 +268,16 @@ private static bool InstallSourceKnown(string url)
268268 return false ;
269269
270270 var author = pieces [ 3 ] ;
271+ var acceptedHost = "github.com" ;
271272 var acceptedSource = "https://github.com" ;
272273 var constructedUrlPart = string . Format ( "{0}/{1}/" , acceptedSource , author ) ;
273274
274- return url . StartsWith ( acceptedSource ) &&
275- App . API . GetAllPlugins ( ) . Any ( x =>
276- ! string . IsNullOrEmpty ( x . Metadata . Website ) &&
277- x . Metadata . Website . StartsWith ( constructedUrlPart )
278- ) ;
275+ if ( ! Uri . TryCreate ( url , UriKind . Absolute , out var uri ) || uri . Host != acceptedHost )
276+ return false ;
277+
278+ return App . API . GetAllPlugins ( ) . Any ( x =>
279+ ! string . IsNullOrEmpty ( x . Metadata . Website ) &&
280+ x . Metadata . Website . StartsWith ( constructedUrlPart )
281+ ) ;
279282 }
280283}
Original file line number Diff line number Diff line change @@ -626,14 +626,17 @@ private bool InstallSourceKnown(string url)
626626 return false ;
627627
628628 var author = pieces [ 3 ] ;
629+ var acceptedHost = "github.com" ;
629630 var acceptedSource = "https://github.com" ;
630631 var constructedUrlPart = string . Format ( "{0}/{1}/" , acceptedSource , author ) ;
631632
632- return url . StartsWith ( acceptedSource ) &&
633- Context . API . GetAllPlugins ( ) . Any ( x =>
634- ! string . IsNullOrEmpty ( x . Metadata . Website ) &&
635- x . Metadata . Website . StartsWith ( constructedUrlPart )
636- ) ;
633+ if ( ! Uri . TryCreate ( url , UriKind . Absolute , out var uri ) || uri . Host != acceptedHost )
634+ return false ;
635+
636+ return Context . API . GetAllPlugins ( ) . Any ( x =>
637+ ! string . IsNullOrEmpty ( x . Metadata . Website ) &&
638+ x . Metadata . Website . StartsWith ( constructedUrlPart )
639+ ) ;
637640 }
638641
639642 internal async ValueTask < List < Result > > RequestInstallOrUpdateAsync ( string search , CancellationToken token ,
You can’t perform that action at this time.
0 commit comments