Fixed issue with Paths-integers being converted using local culture. (#11180)

* Fixed issue with Paths-integers being converted using local culture.

* Align with the old implementation

* Use int.TryParse insteaad of TryConvertTo when we do not want culture specific parsing

* More fixes for cultures and fixed wrong test. Users should be part of all groups to have access

* Fix casing for requested file

* Force tests to not use NLS

* try force tests to not use NLS

* try force tests to not use NLS

* Force tests on windows to run ICU

* More fixes for invariant int parsing

* Change key on actions/emptyRecycleBin, so the casing aligns with the view file, that is named emptyrecyclebin.html

* Fixed casing issue

* use Attempt to align with other code
This commit is contained in:
Bjarke Berg
2021-09-24 17:42:31 +02:00
committed by GitHub
parent 936757297e
commit 452097d975
49 changed files with 174 additions and 262 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Net.Http;
using System.Net.Mime;
@@ -524,15 +525,14 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
return ValidationProblem(validatePassword.Errors.ToErrorMessage());
}
Attempt<int> intId = identityMember.Id.TryConvertTo<int>();
if (intId.Success == false)
if (!int.TryParse(identityMember.Id, NumberStyles.Integer, CultureInfo.InvariantCulture, out var intId))
{
return ValidationProblem("Member ID was not valid");
}
var changingPasswordModel = new ChangingPasswordModel
{
Id = intId.Result,
Id = intId,
OldPassword = contentItem.Password.OldPassword,
NewPassword = contentItem.Password.NewPassword,
};