From b44b67220a5f4da227146f9deeb046501f9cbdd1 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 31 Aug 2020 07:39:05 +1000 Subject: [PATCH 1/3] encode # symbol part of the path when creating uri --- .../Search/WindowsIndex/IndexSearch.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs index 08511091e0e..cc91de02535 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs @@ -51,7 +51,10 @@ internal List ExecuteWindowsIndexSearch(string indexQueryString, string { if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value) { - var path = new Uri(dataReaderResults.GetString(1)).LocalPath; + // # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path + var encodedFragmentPath = dataReaderResults.GetString(1).Replace("#", "%23"); + + var path = new Uri(encodedFragmentPath).LocalPath; if (dataReaderResults.GetString(2) == "Directory") { From afb61b247be5417d955bde94cf978ce41509d1d6 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Mon, 31 Aug 2020 07:46:24 +1000 Subject: [PATCH 2/3] version bump Explorer plugin --- Plugins/Flow.Launcher.Plugin.Explorer/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json index 67d2e731c43..7c6ef82b04c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json @@ -7,7 +7,7 @@ "Name": "Explorer", "Description": "Search and manage files and folders. Explorer utilises Windows Index Search", "Author": "Jeremy Wu", - "Version": "1.2.2", + "Version": "1.2.4", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll", From 6dd7259fcca319e4a4288621830cc790f20aa685 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 1 Sep 2020 07:52:42 +1000 Subject: [PATCH 3/3] use StringComparison.OrdinalIgnoreCase when calling String.Replace --- .../Search/WindowsIndex/IndexSearch.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs index cc91de02535..cca4f209d44 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs @@ -52,7 +52,9 @@ internal List ExecuteWindowsIndexSearch(string indexQueryString, string if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value) { // # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path - var encodedFragmentPath = dataReaderResults.GetString(1).Replace("#", "%23"); + var encodedFragmentPath = dataReaderResults + .GetString(1) + .Replace("#", "%23", StringComparison.OrdinalIgnoreCase); var path = new Uri(encodedFragmentPath).LocalPath;