Developer forum

Forum » PIM » Escaping " character in custom productfield not correctly shown in PIM

Escaping " character in custom productfield not correctly shown in PIM

Barend Mosch
Reply

Hi!

I have a custom made product field, with some extra validation and an extra error message.

This field can hold anything, but mainly test with the occasional double quotes ("), like this:


DW will not show anything after the quotes in the PIM

In the Render method of the ProductFieldTypeProvider, the value gets escaped:
The 'control' object has the correct value for Value.

Inspecting the element in PIM removes the escape, see value parameter.

Is there something Im missing in the Render method?

Thanks in advance,
Barend Mosch, Bluedesk


Replies

 
Barend Mosch
Reply

I found a fix by making the quote an entity

Is it possible to integrate this in core DW?

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Barend

You should html encode the value instead - that will also handle other scenarios of e.g. <, >, # and other ugly stuff.

I think it could cause ohter undesired issues doing this by default.

BR Nicolai

Votes for this answer: 1
 
Barend Mosch
Reply

Alright, thanks Nicolai!

I'll look into it.

 

You must be logged in to post in the forum