PHPackages                             t3g/svg-sanitizer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. t3g/svg-sanitizer

AbandonedArchivedTypo3-cms-extension[Validation &amp; Sanitization](/categories/validation)

t3g/svg-sanitizer
=================

Sanitize SVG files on upload

1.0.3(6y ago)320.8k↓100%2[2 issues](https://github.com/TYPO3GmbH/svg_sanitizer/issues)GPL-2.0-or-laterPHP

Since Dec 16Pushed 4y ago8 watchersCompare

[ Source](https://github.com/TYPO3GmbH/svg_sanitizer)[ Packagist](https://packagist.org/packages/t3g/svg-sanitizer)[ RSS](/packages/t3g-svg-sanitizer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (9)Versions (5)Used By (0)Security (1)

SVG Sanitizer
=============

[](#svg-sanitizer)

This extension will sanitize any SVG file uploaded to the TYPO3 system, but only with the default options. Please read the following section carefully for all details.

Important to know
-----------------

[](#important-to-know)

This extension removes all script and data values in attributes. This means that, for example, embedded graphics such as PNGs are also removed:

```
   // before parser

   // after parser

```

What this extension does
------------------------

[](#what-this-extension-does)

- Hooks into FAL API: `ResourceFactory::addFile()` and `ResourceFactory::replaceFile()`
- Hooks into FAL API: `ResourceStorage::setFileContents()`
- Hooks into DataHandler: Handling files for group/select function
- Hooks into `GeneralUtility::upload_copy_move()`
- Hooks into `GeneralUtility::upload_to_tempfile()`
- Provide an upgrade wizard for existing SVG files (please read the warnings in the upgrade wizard carefully)

WARNING
-------

[](#warning)

This extension can only sanitize the files if the upload is done in one of the ways described above. For example, if a third-party extension allows to upload files and does not use the core APIs described above, SVG Sanitizer cannot sanitize these files.

Credits
-------

[](#credits)

Thanks to Daryll Doyle and his [svg-sanitizer library](https://github.com/darylldoyle/svg-sanitizer)

Bundling PHAR of external library
---------------------------------

[](#bundling-phar-of-external-library)

The process of bundling a composer package into a dedicated PHAR archive has been taken from blog post ["How to use PHP libraries in legacy extensions"](http://insight.helhum.io/post/148112375750/how-to-use-php-libraries-in-legacy-extensions).

First install bundler package `clue/phar-composer` globally

```
composer global require clue/phar-composer

```

Then inside the extension folder create the PHAR archive (in case global composer binaries are not part of the PATH environment, it's possible to invoke `~/.composer/vendor/bin/phar-composer)` directly)

```
cd typo3conf/ext/svg_sanitizer
phar-composer build enshrined/svg-sanitize Libraries/enshrined-svg-sanitize.phar

```

Issue Reporting
---------------

[](#issue-reporting)

Please report any issues with the extension at [Github](https://github.com/TYPO3GmbH/svg_sanitizer/issues).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Total

4

Last Release

2191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63373213aae432ce35282f7b1f0843556ca1127c9e2ea39dbeffd990c41c4427?d=identicon)[typo3com](/maintainers/typo3com)

---

Top Contributors

[![NeoBlack](https://avatars.githubusercontent.com/u/1128085?v=4)](https://github.com/NeoBlack "NeoBlack (50 commits)")[![andreaskienast](https://avatars.githubusercontent.com/u/1787983?v=4)](https://github.com/andreaskienast "andreaskienast (7 commits)")[![ohader](https://avatars.githubusercontent.com/u/402145?v=4)](https://github.com/ohader "ohader (2 commits)")[![sgrossberndt](https://avatars.githubusercontent.com/u/3786510?v=4)](https://github.com/sgrossberndt "sgrossberndt (1 commits)")

---

Tags

typo3typo3-cms-extension

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/t3g-svg-sanitizer/health.svg)

```
[![Health](https://phpackages.com/badges/t3g-svg-sanitizer/health.svg)](https://phpackages.com/packages/t3g-svg-sanitizer)
```

###  Alternatives

[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M775](/packages/typo3-testing-framework)[pagemachine/typo3-formlog

Form log for TYPO3

23225.3k6](/packages/pagemachine-typo3-formlog)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1481.0k](/packages/eliashaeussler-typo3-form-consent)[linawolf/form_double_opt_in

Double Opt-In for the TYPO3 CMS Form Framework

1412.8k](/packages/linawolf-form-double-opt-in)[mautic/mautic-typo3

Add-on TYPO3 extension that enhances the "EXT:marketing\_automation" TYPO3 extension by connecting it to the Mautic Marketing Automation platform: Determine "Persona" from Mautic segments. Also provides additional services e.g. language synchronisation between Mautic and TYPO3.

236.3k](/packages/mautic-mautic-typo3)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
