Fixed issue where query string parameters were not being URL encoded correctly, causing problems if a dictionary value contains a = or & symbol

This commit is contained in:
pcw@pcw-PC.shout.local
2013-01-14 21:08:57 +00:00
parent e738ec9437
commit a75fe0ed7a

View File

@@ -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('&');
}