legacy-knowledge-base
公開されました Jul. 2, 2025

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

問題

  • サイト間、つまりナレッジ ベース間でコンテンツをインポートしようとすると、検証エラーが発生します。
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

解像度

  • AntiSamy 検証ディレクティブがファイルで定義されています
/META-INF/resources/sanitizer-configuration.xml
このファイルは、DXP 製品の AntiSamy バンドルにパッケージ化されています。
com.liferay.portal.security.antisamy-x.y.x.jar
そして、そのバンドルは LPKG ファイルにパッケージ化されています。
osgi/marketplace/Liferay Foundation.lpkg
  • というわけで、まず、 Liferay Foundation.lpkg から com.liferay.portal.security.antisamy-xyzjar ファイルを抽出します。 注: LPKG 形式は Liferay パッケージ形式です。
  • 同じディレクトリ構造で、 com.liferay.portal.security.antisamy-xyzjarからコンテンツを抽出します。
  • 次のファイルを編集します。
META-INF/resources/sanitizer-configuration.xml
  • 検索ディレクティブ
<directive name="maxInputSize" value="200000"/>
カスタム値で編集します。 ファイルを保存。
  • 以前に編集したファイルでバンドルを更新します。
jar uf com.liferay.portal.security.antisamy-x.y.x.jar META-INF/resources/sanitizer-configuration.xml
  • 追加 (上書き) com.liferay.portal.security.antisamy-xyzjar ファイルに Liferay Foundation.lpkg
  • アプリケーション サーバーをシャットダウンします。
  • パスLiferay Foundation.lpkg をコピー (上書き) osgi/marketplace/
  • osgi/state/ ディレクトリの内容を削除します。
  • アプリケーション サーバーを起動し、ディレクティブ カスタム値が使用されていることを確認します。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base