From 0db594b2d39c93dd2e911414bee5520c84048906 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Wed, 15 Aug 2018 17:57:40 +1200 Subject: [PATCH] FIX Remove double escaping of HTML values in print views Print view uses the SilverStripe templating to render values which means that values are safely escaped by default. This can be tested by chaing `$CellString` to `$CellString.RAW` in the GridField_print.ss template to see this escaping being disabled. This pull request removes double escaping of HTML in strings. --- src/Forms/GridField/GridFieldPrintButton.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Forms/GridField/GridFieldPrintButton.php b/src/Forms/GridField/GridFieldPrintButton.php index 758de42c6..ef144bb0e 100644 --- a/src/Forms/GridField/GridFieldPrintButton.php +++ b/src/Forms/GridField/GridFieldPrintButton.php @@ -227,10 +227,6 @@ class GridFieldPrintButton implements GridField_HTMLProvider, GridField_ActionPr foreach ($printColumns as $field => $label) { $value = $gridField->getDataFieldValue($item, $field); - if ($item->escapeTypeForField($field) != 'xml') { - $value = Convert::raw2xml($value); - } - $itemRow->push(new ArrayData(array( "CellString" => $value, )));