RTE Plugin modifying HTML || Removing JS functions like onClick="" | Community
Skip to main content
February 19, 2019
Solved

RTE Plugin modifying HTML || Removing JS functions like onClick=""

  • February 19, 2019
  • 5 replies
  • 3655 views

RTE plugin is modifying my html content while using source edit option.

How to work around this ?

Is there any option to avoid this?

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gaurav-Behl

You'd need to overlay either or both based on how you've coded-

  1. /libs/cq/xssprotection/config.xml
  2. /libs/sling/xss/config.xml

Refer Re: links to ppt not working on OOB text component  for detailed configurations. Allow those specific characters that are printed in the logs -

(

,

'

)

5 replies

smacdonald2008
February 19, 2019

How is your HTML being modified? Can you please provide more details. Are you using AEM 6.4 and Touch UI?

Gaurav-Behl
February 19, 2019

check if you can find any AntiSamy or other related errors in error.log for this component/page?

February 21, 2019

Yes I am getting AntiSamy in logs

**** GET / org.apache.sling.xss.impl.HtmlToHtmlContentContext AntiSamy warning: The a tag contained an attribute that we could not process. The onclick attribute had a value of "openTab(event, 'All')". This value could not be accepted for security reasons. We have chosen to remove this attribute from the tag and leave everything else in place so that we could process the input.*****

Gaurav-Behl
Gaurav-BehlAccepted solution
February 21, 2019

You'd need to overlay either or both based on how you've coded-

  1. /libs/cq/xssprotection/config.xml
  2. /libs/sling/xss/config.xml

Refer Re: links to ppt not working on OOB text component  for detailed configurations. Allow those specific characters that are printed in the logs -

(

,

'

)

February 22, 2019

Thanks a ton! Reference link was very helpful.