silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
722 stars 822 forks source link

GridField Print view double escapes data #9389

Open maxime-rainville opened 4 years ago

maxime-rainville commented 4 years ago

Affected Version

Tested on 4.6, but presumably the entire 4 branch is affected

Description

If your GridField summary view contains data with special characters and you hit the print button, those special characters will be double escape in the print view. e.g.: If your grid field contains the string "love > hate", the actual raw HTML sent to browser will be:

image

<td>Love &amp;gt; Hate</td>

Which will appear as "Love &gt; Hate".

Steps to Reproduce

Expected results: The new Company name is displayed with the "greater than" signs properly escape.

Actual results: The "greater than" signs are double escaped.

robbieaverill commented 4 years ago

Upstream issue in userforms: https://github.com/silverstripe/silverstripe-userforms/issues/633

Since this looks like a core bug it's worth checking when this is fixed that it doesn't affect the userforms equivalent bug, or patch it again if it does.

Cheddam commented 4 years ago

Marking this as type/UX, because it affects the behaviour of a feature used by CMS authors and will be causing them additional effort to work around.