2

Below is the example code for this issue

<apex:OutputText value="{!question.selectedVal}" escape="false"/>

We cannot remove the escape false because we need to show the HTML content. How to pass security review for this code?

3

In order to resolve this issue you will need to change the code as below

<apex:OutputText value="{!question.selectedVal}" escape="false"/>

To

<apex:outputPanel id="richtextelement"/>
<script>var richtextelement = document.getElementById('{!$Component.richtextelement}'); $(richtextelement).html($('<div/>').html('{!JSENCODE(question.selectedVal)}').html());</script>
  • You will need to include jquery refresh to work this code. – Sagar Thoriya Nov 16 '17 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.