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:
Shannon
2015-08-11 15:56:48 +02:00
parent cfb84cae44
commit 9e6a2d8a7c
2 changed files with 31 additions and 1 deletions

View File

@@ -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);
}
}
}