diff --git a/DNN Platform/Library/Services/FileSystem/FolderManager.cs b/DNN Platform/Library/Services/FileSystem/FolderManager.cs index 2f6a2b40d43..d224318b36b 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderManager.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderManager.cs @@ -1843,15 +1843,7 @@ internal virtual bool CanMoveBetweenFolderMappings(FolderMappingInfo sourceFolde private static Regex WildcardToRegex(string pattern) { - if (!pattern.Contains("*") && !pattern.Contains("?")) - { - pattern = ".*" + Regex.Escape(pattern) + ".*"; - } - else - { - pattern = Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", "."); - } - + pattern = Regex.Escape(pattern).Replace(@"\*", ".*").Replace(@"\?", "."); return RegexUtils.GetCachedRegex(pattern, RegexOptions.IgnoreCase); }