diff --git a/DNN Platform/Library/Services/FileSystem/FolderManager.cs b/DNN Platform/Library/Services/FileSystem/FolderManager.cs index ded6cc7c30c..2f6a2b40d43 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderManager.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderManager.cs @@ -1845,11 +1845,11 @@ private static Regex WildcardToRegex(string pattern) { if (!pattern.Contains("*") && !pattern.Contains("?")) { - pattern = "^" + pattern + ".*$"; + pattern = ".*" + Regex.Escape(pattern) + ".*"; } else { - pattern = "^" + Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", ".") + "$"; + pattern = Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", "."); } return RegexUtils.GetCachedRegex(pattern, RegexOptions.IgnoreCase); diff --git a/DNN Platform/Modules/ResourceManager/Components/SearchController.cs b/DNN Platform/Modules/ResourceManager/Components/SearchController.cs index 3a66f90ffc6..6fdb222c104 100644 --- a/DNN Platform/Modules/ResourceManager/Components/SearchController.cs +++ b/DNN Platform/Modules/ResourceManager/Components/SearchController.cs @@ -34,11 +34,7 @@ public IList SearchFolderContent(int moduleId, IFolderInfo folder, bo search = (search ?? string.Empty).Trim(); - // Lucene does not support wildcards as the beginning of the search - // For file names we can remove any existing wildcard at the beginning - var cleanedKeywords = TrimStartWildCards(search); - - var files = FolderManager.Instance.SearchFiles(folder, cleanedKeywords, recursive); + var files = FolderManager.Instance.SearchFiles(folder, search, recursive); var sortProperties = SortProperties.Parse(sorting); var sortedFiles = SortFiles(files, sortProperties).ToList(); totalCount = sortedFiles.Count; @@ -46,14 +42,6 @@ public IList SearchFolderContent(int moduleId, IFolderInfo folder, bo return sortedFiles.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); } - private static string TrimStartWildCards(string search) - { - var keywords = from keyword in search.Split(' ') - select keyword.TrimStart('*', '?'); - search = string.Join(" ", keywords); - return search; - } - private static IEnumerable SortFiles(IEnumerable files, SortProperties sortProperties) { switch (sortProperties.Column) diff --git a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less index 71c1a1e1229..2643b6ffdef 100644 --- a/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less +++ b/DNN Platform/Modules/ResourceManager/ResourceManager.Web/app/less/components.less @@ -29,7 +29,6 @@ margin: 0px; list-style: none; box-sizing: border-box; - height: 28px; } }