Fixes: U4-2627 Ensure that the plugins cache files are named with the machine name

This commit is contained in:
Shannon
2013-08-16 12:25:38 +10:00
parent d0a9e3236e
commit 973b466798
4 changed files with 65 additions and 4 deletions

View File

@@ -28,6 +28,17 @@ namespace Umbraco.Core
[UmbracoWillObsolete("Do not use this constants. See IShortStringHelper.CleanStringForSafeAliasJavaScriptCode.")]
public const string UmbracoInvalidFirstCharacters = "01234567890";
internal static string ReplaceNonAlphanumericChars(this string input, char replacement)
{
//any character that is not alphanumeric, convert to a hyphen
var mName = input;
foreach (var c in mName.ToCharArray().Where(c => !char.IsLetterOrDigit(c)))
{
mName = mName.Replace(c, replacement);
}
return mName;
}
public static string ExceptChars(this string str, HashSet<char> toExclude)
{
var sb = new StringBuilder(str.Length);