Legacy Knowledge Base
Published Jul. 2, 2025

How to configure validation directives in AntiSamy

Written By

Sergio Alonso

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When trying to import content between sites, i.e. knowledge base, a validation error arises:
An unexpected error occurred with the publication process. Please check your portal and publishing configuration.

com.liferay.portal.kernel.exception.SystemException: com.liferay.portal.kernel.sanitizer.SanitizerException: org.owasp.validator.html.ScanException: The input was too large. The specified input was 215.183 bytes and the maximum is 200.000 bytes.

 

Environment

  • Liferay DXP 7.0

Resolution

  • AntiSamy validation directives are defined in the file
/META-INF/resources/sanitizer-configuration.xml
This file is packaged in DXP product's AntiSamy bundle:
com.liferay.portal.security.antisamy-x.y.x.jar
And that bundle is packaged in LPKG file:
osgi/marketplace/Liferay Foundation.lpkg
  • So, firstly, extract com.liferay.portal.security.antisamy-x.y.z.jar file from Liferay Foundation.lpkg. Note: LPKG format is Liferay packaging format.
  • Extract the content from com.liferay.portal.security.antisamy-x.y.z.jar, with the same directory structure.
  • Edit following file:
META-INF/resources/sanitizer-configuration.xml
  • Find directive
<directive name="maxInputSize" value="200000"/>
and edit with custom value. Save file.
  • Update bundle with previous edited file:
jar uf com.liferay.portal.security.antisamy-x.y.x.jar META-INF/resources/sanitizer-configuration.xml
  • Add (overwrite) com.liferay.portal.security.antisamy-x.y.z.jar file in Liferay Foundation.lpkg
  • Shutdown application server.
  • Copy (overwrite) Liferay Foundation.lpkg in pathosgi/marketplace/
  • Delete osgi/state/ directory content.
  • Boot application server and check the directive custom value is used.

Additional Information

 

 

Did this article resolve your issue ?

Legacy Knowledge Base