OpenStore
OpenStore copied to clipboard
Categories with ampersand cause issues
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...
- either make sure that categories cannot have a name with an ampersand
- or (better) make sure that the ampersand does not cause problems in the module settings
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.