asp.netsitecorequery-stringsitecore7sitecore7.5

Why does Sitecore seem to mangle parentheses in the query string?


I am noticing something strange with Sitecore and parentheses in the query string. For some reason Sitecore seems to be doing something odd to the query string. Here are the steps to reproduce this behavior:

  1. Install Sitecore 7.5
  2. Create a simple sublayout called TestSublayout
  3. On the TestSublayout add an ASP Literal tag called litTest
  4. In the code behind for the sublayout, in the Page Load event add the following code: litTest.Text = Request.QueryString.ToString();
  5. Create a simple item in Sitecore called TestItem and use the Sample Item data template
  6. In the presentation details for TestItem, put the TestSublayout in the main placeholder.
  7. Build the Visual Studio project and publish the site.
  8. Open up a browser and go to http://example.com/testitem.aspx?selecteditem=surf(x)%203D%20Laminates

For some reason, Sitecore does something with the parentheses and this is what you see on the screen:

selecteditem=surf&%2340%3bx&%2341%3b+3D+Laminates

The reason I believe that Sitecore is doing something, is that I tried these exact same steps on a non-Sitecore project and it worked fine. The parentheses were not garbled or translated in to anything. They were just in the string as I would expect like this:

selecteditem=surf(x)%203D%20Laminates

Any ideas?


Solution

  • I found out from Sitecore that this was a known problem that was fixed in version 7.2 but had not been merged in to the 7.5 release. So they gave me a patch that fixed the problem.