RTE Plugin modifying HTML || Removing JS functions like onClick="" | Community
Skip to main content
Level 2
Feb 19, 2019 12:50 PM UTC
Solved

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

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.
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Feb 21, 2019 3:44 PM UTC

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

Level 2
Feb 22, 2019 10:27 AM UTC

Thanks a ton! Reference link was very helpful.

Translate
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Feb 21, 2019 3:44 PM UTC

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 -

(

,

'

)

Translate
Level 2
Feb 21, 2019 5:54 AM UTC

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.*****

Translate
Gaurav-Behl
Level 10
Feb 19, 2019 5:20 PM UTC

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

Translate
smacdonald2008
Level 10
Feb 19, 2019 2:18 PM UTC

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

Translate