問題
- サイト間、つまりナレッジ ベース間でコンテンツをインポートしようとすると、検証エラーが発生します。
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
com.liferay.portal.security.antisamy-x.y.x.jar
osgi/marketplace/Liferay Foundation.lpkg
- というわけで、まず、
Liferay Foundation.lpkg から
注: LPKG 形式は Liferay パッケージ形式です。com.liferay.portal.security.antisamy-xyzjar
ファイルを抽出します。 - 同じディレクトリ構造で、
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/
ディレクトリの内容を削除します。 - アプリケーション サーバーを起動し、ディレクティブ カスタム値が使用されていることを確認します。
追加情報
- モジュールバンドル外の AntiSamy 構成ファイルを指定できるようにする機能リクエスト: https://issues.liferay.com/browse/LPS-88322