Fixing: U4-6942 During upgrade MUST make sure that the new Property Type GUIDs are consistent ... just needs some testing now;
This commit is contained in:
@@ -1409,5 +1409,18 @@ namespace Umbraco.Core
|
||||
{
|
||||
return string.IsNullOrEmpty(text) ? text : InvalidXmlChars.Replace(text, "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a string to a Guid - WARNING, depending on the string, this may not be unique
|
||||
/// </summary>
|
||||
/// <param name="text"></param>
|
||||
/// <returns></returns>
|
||||
internal static Guid ToGuid(this string text)
|
||||
{
|
||||
var md5 = MD5.Create();
|
||||
byte[] myStringBytes = Encoding.ASCII.GetBytes(text);
|
||||
byte[] hash = md5.ComputeHash(myStringBytes);
|
||||
return new Guid(hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user