From a75fe0ed7afa526f26c9f2dffe86195d0e2f15d4 Mon Sep 17 00:00:00 2001 From: "pcw@pcw-PC.shout.local" Date: Mon, 14 Jan 2013 21:08:57 +0000 Subject: [PATCH] Fixed issue where query string parameters were not being URL encoded correctly, causing problems if a dictionary value contains a = or & symbol --- src/Umbraco.Core/DictionaryExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/DictionaryExtensions.cs b/src/Umbraco.Core/DictionaryExtensions.cs index 7e09b519a8..83d89fcaba 100644 --- a/src/Umbraco.Core/DictionaryExtensions.cs +++ b/src/Umbraco.Core/DictionaryExtensions.cs @@ -5,6 +5,7 @@ using System.Collections.Specialized; using System.Linq; using System.Text; using System.Web.Mvc; +using System.Web; namespace Umbraco.Core { @@ -158,7 +159,7 @@ namespace Umbraco.Core var builder = new StringBuilder(); foreach (var i in d) { - builder.Append(String.Format("{0}={1}&", i.Key, i.Value)); + builder.Append(String.Format("{0}={1}&", HttpUtility.UrlEncode(i.Key), i.Value == null ? string.Empty : HttpUtility.UrlEncode(i.Value.ToString()))); } return builder.ToString().TrimEnd('&'); }