Merge remote-tracking branch 'origin/6.2.0' into 7.1.0
Conflicts: src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs src/Umbraco.Core/Services/IMembershipUserService.cs src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs src/Umbraco.Web.UI/config/trees.config src/Umbraco.Web.UI/config/umbracoSettings.config src/Umbraco.Web.UI/umbraco/controls/ContentTypeControlNew.ascx src/Umbraco.Web.UI/umbraco/developer/DataTypes/editDatatype.aspx src/Umbraco.Web.UI/umbraco/plugins/uGoLive/Dashboard.ascx src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs src/Umbraco.Web/Search/ExamineEvents.cs src/Umbraco.Web/Umbraco.Web.csproj src/Umbraco.Web/umbraco.presentation/content.cs src/Umbraco.Web/umbraco.presentation/umbraco/cache/LegacyClasses.cs
This commit is contained in:
@@ -246,12 +246,14 @@ namespace Umbraco.Core
|
||||
else if (destinationType == typeof(Double))
|
||||
{
|
||||
Double value;
|
||||
return Double.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
|
||||
var input2 = NormalizeNumberDecimalSeparator(input);
|
||||
return Double.TryParse(input2, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
|
||||
}
|
||||
else if (destinationType == typeof(Single))
|
||||
{
|
||||
Single value;
|
||||
return Single.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
|
||||
var input2 = NormalizeNumberDecimalSeparator(input);
|
||||
return Single.TryParse(input2, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
|
||||
}
|
||||
else if (destinationType == typeof(Char))
|
||||
{
|
||||
@@ -320,7 +322,8 @@ namespace Umbraco.Core
|
||||
else if (destinationType == typeof(Decimal))
|
||||
{
|
||||
Decimal value;
|
||||
return Decimal.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
|
||||
var input2 = NormalizeNumberDecimalSeparator(input);
|
||||
return Decimal.TryParse(input2, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
|
||||
}
|
||||
else if (destinationType == typeof(Version))
|
||||
{
|
||||
@@ -332,6 +335,14 @@ namespace Umbraco.Core
|
||||
return null; // we can't decide...
|
||||
}
|
||||
|
||||
private readonly static char[] NumberDecimalSeparatorsToNormalize = new[] {'.', ','};
|
||||
|
||||
private static string NormalizeNumberDecimalSeparator(string s)
|
||||
{
|
||||
var normalized = System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat.NumberDecimalSeparator[0];
|
||||
return s.ReplaceMany(NumberDecimalSeparatorsToNormalize, normalized);
|
||||
}
|
||||
|
||||
internal static void CheckThrowObjectDisposed(this IDisposable disposable, bool isDisposed, string objectname)
|
||||
{
|
||||
//TODO: Localise this exception
|
||||
|
||||
Reference in New Issue
Block a user