diff --git a/src/Framework/Framework/Routing/UrlHelper.cs b/src/Framework/Framework/Routing/UrlHelper.cs index 1ec51999e0..132a5581db 100644 --- a/src/Framework/Framework/Routing/UrlHelper.cs +++ b/src/Framework/Framework/Routing/UrlHelper.cs @@ -55,7 +55,7 @@ private static string AppendQueryParam(ref string urlSuffix, string name, string return (!hasValue) ? urlSuffix += Uri.EscapeDataString(name) : - urlSuffix += $"{Uri.EscapeDataString(name)}={value}"; + urlSuffix += $"{Uri.EscapeDataString(name)}={Uri.EscapeDataString(value)}"; } /// @@ -137,16 +137,15 @@ private static bool ContainsOnlyValidUrlChars(string url) } else if (ReflectionUtils.TryGetCustomPrimitiveTypeRegistration(value.GetType()) is { } registration) { - return Uri.EscapeDataString(registration.ToStringMethod(value)); + return registration.ToStringMethod(value); } else if (value is IConvertible convertible) { - return Uri.EscapeDataString(convertible.ToString(CultureInfo.InvariantCulture)); + return convertible.ToString(CultureInfo.InvariantCulture); } else { - var strVal = value.ToString(); - return strVal == null ? null : Uri.EscapeDataString(strVal); + return value.ToString(); } } }