Disable blocking of SVG files with JavaScript code
Version: 10.4
For security reasons, Scalable Vector Graphics (SVG) files with JavaScript code are blocked when you upload media files to the Media Library. You can turn this feature off by creating a patch config file that deletes the validation processor that checks SVG files for JavaScript code. The processor is called CheckSvgForJs and is part of the validateMedia pipeline. Turning off the feature affects all applications that upload files to the Media Library, for example, the Content Editor.
To disable blocking of SVG files:
-
Create a patch config file.
-
Paste the following code into the file:
RequestResponse<?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <pipelines> <validateMedia> <processor type="Sitecore.Pipelines.ValidateMedia.CheckSvgForJs,Sitecore.Kernel" > <patch:delete/> </processor> </validateMedia> </pipelines> </sitecore> </configuration> -
Save the file to the following folder: /App_Config/Include.