Fix #5054: parse string to number with invariant culture.

This commit is contained in:
Ben
2025-02-10 16:23:41 +08:00
parent 189f8f1d27
commit 1aabb93f77
37 changed files with 109 additions and 76 deletions

View File

@ -36,7 +36,7 @@ namespace Oqtane.Services
if (!Enum.TryParse(position, true, out AnchorPositionMode _)) position = "center";
if (!Color.TryParseHex("#" + background, out _)) background = "transparent";
if (!int.TryParse(rotate, out _)) rotate = "0";
rotate = (int.Parse(rotate) < 0 || int.Parse(rotate) > 360) ? "0" : rotate;
rotate = (SharedConverter.ParseInteger(rotate) < 0 || SharedConverter.ParseInteger(rotate) > 360) ? "0" : rotate;
if (!_formats.Contains(format)) format = "png";
using (var stream = new FileStream(filepath, FileMode.Open, FileAccess.Read))