Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Varbase FAQs 9.2.1 Minor update available for module varbase_faqs (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

SVG Upload Sanitizer

280 sites No security coverage
View on drupal.org

This module automatically sanitizes all uploaded SVG files to improve security. It uses the darylldoyle/svg-sanitizer package to perform the sanitization process.

Introduction

The SVG Upload Sanitizer module provides a simple way to sanitize
uploaded svg.

Every uploaded svg is automatically sanitize.

To sanitize SVG this module rest upon the darylldoyle/svg-sanitizer package.

Requirements

The module requires the following package:

Installation

Install as you would normally install a contributed Drupal module. See: Installing Modules for further information.

Configuration

This module has no opinion regarding the configuration of the darylldoyle/svg-sanitizer package.

The default behavior of darylldoyle/svg-sanitizer is used.

With the current implementation it should already be possible to configure darylldoyle/svg-sanitizer just by decorating the service. For instance to remove references to remote files you just have to call the method provided by darylldoyle/svg-sanitizer like:

# mymodule.services.yml

services:
  mymodule.sanitizer.svg:
    decorates: svg_upload_sanitizer.sanitizer.svg
    class: enshrined\svgSanitize\Sanitizer
    calls:
      - [removeRemoteReferences, [TRUE]]

Similar modules

How to contribute

Issues and Merge requests has to be done on https://gitlab.com/beram-drupal/svg-upload-sanitizer

Maintainers

Activity

Total releases
4
First release
Jan 2025
Latest release
10 months ago
Releases (12 mo)
1 ▼ from 3
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
8.x-2.1 Stable Aug 28, 2025
8.x-2.0 Stable Apr 15, 2025
8.x-2.0-alpha1 Pre-release Jan 15, 2025
8.x-2.x-dev Dev Jan 15, 2025