Merge remote-tracking branch 'origin/dev-v7' into dev-v8

Conflicts:
	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
	src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs
	src/Umbraco.Web/Umbraco.Web.csproj
	src/Umbraco.Web/WebApi/Filters/DisableBrowserCacheAttribute.cs
This commit is contained in:
Shannon
2016-04-12 15:16:19 +02:00
46 changed files with 510 additions and 166 deletions

View File

@@ -1286,6 +1286,30 @@ namespace Umbraco.Core
*/
}
public static string EscapeRegexSpecialCharacters(this string text)
{
var regexSpecialCharacters = new Dictionary<string, string>
{
{".", @"\."},
{"(", @"\("},
{")", @"\)"},
{"]", @"\]"},
{"[", @"\["},
{"{", @"\{"},
{"}", @"\}"},
{"?", @"\?"},
{"!", @"\!"},
{"$", @"\$"},
{"^", @"\^"},
{"+", @"\+"},
{"*", @"\*"},
{"|", @"\|"},
{"<", @"\<"},
{">", @"\>"}
};
return ReplaceMany(text, regexSpecialCharacters);
}
public static bool ContainsAny(this string haystack, IEnumerable<string> needles, StringComparison comparison = StringComparison.CurrentCulture)
{
if (haystack == null) throw new ArgumentNullException("haystack");