Audit culture bugs (#7707)

* Added comments and fixed CultureInfo /  StringComparison where appropriate

* Addressed comments

* Fixed comment
This commit is contained in:
Avneet Kaur
2020-10-30 16:43:09 -07:00
committed by GitHub
parent bd34127cd4
commit 2c5b9b4d52
54 changed files with 160 additions and 28 deletions

View File

@@ -60,6 +60,7 @@ namespace Microsoft.Plugin.Folder.Sources
}
// Remove everything after the last \ and add *
// Using InvariantCulture since this is internal
incompleteName = search.Substring(index + 1)
.ToLower(CultureInfo.InvariantCulture) + "*";
search = search.Substring(0, index + 1);
@@ -71,7 +72,8 @@ namespace Microsoft.Plugin.Folder.Sources
else
{
// folder exist, add \ at the end of doesn't exist
if (!search.EndsWith(@"\", StringComparison.InvariantCulture))
// Using Ordinal since this is internal and is used for a symbol
if (!search.EndsWith(@"\", StringComparison.Ordinal))
{
search += @"\";
}