legacy-knowledge-base
Publicado Jul. 25, 0002

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

learn-legacy-article-disclaimer-text

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