[PTRun][WebSearch] Enable analyzer and fix warnings (#16938)

This commit is contained in:
CleanCodeDeveloper
2022-03-10 11:35:49 +01:00
committed by GitHub
parent 3b04cfd267
commit ffdb5d44d7
2 changed files with 3 additions and 1 deletions

View File

@@ -13,6 +13,8 @@
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath> <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<NeutralLanguage>en-US</NeutralLanguage> <NeutralLanguage>en-US</NeutralLanguage>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Recommended</AnalysisMode>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">

View File

@@ -152,7 +152,7 @@ namespace Community.PowerToys.Run.Plugin.WebSearch
{ {
if (input.EndsWith(":", StringComparison.OrdinalIgnoreCase) if (input.EndsWith(":", StringComparison.OrdinalIgnoreCase)
&& !input.StartsWith("http", StringComparison.OrdinalIgnoreCase) && !input.StartsWith("http", StringComparison.OrdinalIgnoreCase)
&& !input.Contains("/", StringComparison.OrdinalIgnoreCase) && !input.Contains('/', StringComparison.OrdinalIgnoreCase)
&& !input.All(char.IsDigit) && !input.All(char.IsDigit)
&& System.Text.RegularExpressions.Regex.IsMatch(input, @"^([a-z][a-z0-9+\-.]*):")) && System.Text.RegularExpressions.Regex.IsMatch(input, @"^([a-z][a-z0-9+\-.]*):"))
{ {