mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Audit culture bugs (#7707)
* Added comments and fixed CultureInfo / StringComparison where appropriate * Addressed comments * Fixed comment
This commit is contained in:
@@ -119,6 +119,7 @@ namespace Microsoft.Plugin.Uri
|
||||
?? _registeryWrapper.GetRegistryValue("HKEY_CLASSES_ROOT\\" + progId + "\\DefaultIcon", null);
|
||||
|
||||
// "Handles 'Indirect Strings' (UWP programs)"
|
||||
// Using Ordinal since this is internal and used with a symbol
|
||||
if (programLocation.StartsWith("@", StringComparison.Ordinal))
|
||||
{
|
||||
var directProgramLocationStringBuilder = new StringBuilder(128);
|
||||
@@ -137,6 +138,7 @@ namespace Microsoft.Plugin.Uri
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using Ordinal since this is internal and used with a symbol
|
||||
var indexOfComma = programLocation.IndexOf(',', StringComparison.Ordinal);
|
||||
BrowserIconPath = indexOfComma > 0
|
||||
? programLocation.Substring(0, indexOfComma)
|
||||
|
||||
@@ -18,9 +18,10 @@ namespace Microsoft.Plugin.Uri.UriHelper
|
||||
}
|
||||
|
||||
// Handle common cases UriBuilder does not handle
|
||||
if (input.EndsWith(":", StringComparison.Ordinal)
|
||||
|| input.EndsWith(".", StringComparison.Ordinal)
|
||||
|| input.EndsWith(":/", StringComparison.Ordinal))
|
||||
// Using CurrentCulture since this is a user typed string
|
||||
if (input.EndsWith(":", StringComparison.CurrentCulture)
|
||||
|| input.EndsWith(".", StringComparison.CurrentCulture)
|
||||
|| input.EndsWith(":/", StringComparison.CurrentCulture))
|
||||
{
|
||||
result = default;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user