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:
@@ -42,9 +42,9 @@ namespace Umbraco.Extensions
|
||||
public static int[] GetIdsFromPathReversed(this string path)
|
||||
{
|
||||
var nodeIds = path.Split(Constants.CharArrays.Comma, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(x => x.TryConvertTo<int>())
|
||||
.Select(x => int.TryParse(x, NumberStyles.Integer, CultureInfo.InvariantCulture, out var output) ? Attempt<int>.Succeed(output) : Attempt<int>.Fail())
|
||||
.Where(x => x.Success)
|
||||
.Select(x => x.Result)
|
||||
.Select(x=>x.Result)
|
||||
.Reverse()
|
||||
.ToArray();
|
||||
return nodeIds;
|
||||
|
||||
Reference in New Issue
Block a user