OpenStore icon indicating copy to clipboard operation
OpenStore copied to clipboard

Categories with ampersand cause issues

Open trouble2 opened this issue 4 years ago • 1 comments

When you add an ampersand to a categoryname this will give problems (for example) in the settings of the product_view module. Try setting it to the default category, and it won't save or it wil show an error on the configuration page. So...

  1. either make sure that categories cannot have a name with an ampersand
  2. or (better) make sure that the ampersand does not cause problems in the module settings

trouble2 avatar May 04 '21 07:05 trouble2

The error that shows up on the product view settings can be avoided with a string is null or empty defensive check for the themedata but it results in the module not saving it's data properly anyhow so it's not really a fix.

The issue lies in the selectedtext attribute of the defaultcatid element that is being generated by the GetGenXmlByAjax func executed by NBrightUtils.GetAjaxInfo in NBrightTS.

The input xml handled by the function GetAjaxInfo receives data as elements with the CDATA tag to wrap the ampersand. However the xml generated by the func GetGenXmlByAjax inside this func returns this same data point as an attribute which is not escaping the ampersand so it introduces problems.

I think we can take advantage of System.Security.SecurityElement.Escape to help out. I'll PR it shortly.

DNNMonster avatar May 05 '21 19:05 DNNMonster