Commit eaacd627 authored by Sergey Shepelevich's avatar Sergey Shepelevich

CMS-11040 [Backport 11.2] Adjust for old version of commons-io

parent 4d8f24cf
......@@ -205,7 +205,7 @@ public abstract class GalleryUploadPanel extends Panel {
final boolean svgScriptsEnabled = pluginConfig.getAsBoolean(SVG_SCRIPTS_ENABLED, false);
if (!svgScriptsEnabled && Objects.equals(mimetype, SVG_MIME_TYPE)) {
final String svgContent = IOUtils.toString(istream, StandardCharsets.UTF_8);
final String svgContent = IOUtils.toString(istream, "UTF-8");
if (svgContent.contains("<script")) {
istream.close();
throw new SvgScriptGalleryException("SVG images with embedded script are not supported.");
......
......@@ -143,7 +143,7 @@ public class GalleryWorkflowPlugin extends CompatibilityWorkflowPlugin<GalleryWo
final boolean svgScriptsEnabled = GalleryWorkflowPlugin.this.getPluginConfig()
.getAsBoolean(SVG_SCRIPTS_ENABLED, false);
if (!svgScriptsEnabled && Objects.equals(mimeType, SVG_MIME_TYPE)) {
final String svgContent = IOUtils.toString(is, StandardCharsets.UTF_8);
final String svgContent = IOUtils.toString(is, "UTF-8");
if (svgContent.contains("<script")) {
throw new SvgScriptGalleryException("SVG images with embedded script are not supported.");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment