# Svg

Sane handler for SVG files

****

- Full class name: `Kirby\Sane\Svg`
- Source: <https://github.com/getkirby/kirby/tree/5.5.3/src/Sane/Svg.php#L24>

****

### Svg

- [Svg::sanitize()](https://getkirby.com/docs/reference/objects/sane/svg/sanitize.md)
- [Svg::sanitizeAttr()](https://getkirby.com/docs/reference/objects/sane/svg/sanitize-attr.md)
- [Svg::sanitizeElement()](https://getkirby.com/docs/reference/objects/sane/svg/sanitize-element.md)
- [Svg::sanitizeFile()](https://getkirby.com/docs/reference/objects/sane/svg/sanitize-file.md)
- [Svg::validate()](https://getkirby.com/docs/reference/objects/sane/svg/validate.md)
- [Svg::validateDoctype()](https://getkirby.com/docs/reference/objects/sane/svg/validate-doctype.md)
- [Svg::validateFile()](https://getkirby.com/docs/reference/objects/sane/svg/validate-file.md)

## Allow additional attributes/tags

By default, the sanitizer will strip any attributes or  tags that haven't been flagged as allowed <a href="https://github.com/getkirby/kirby/blob/4.2.0/src/Sane/Svg.php#L37-L387">in the default lists</a>.

If you have a certain attribute or tag in your SVG files that should not be stripped, you can add those as follows:

```php
// <foo> tag
Kirby\Sane\Svg::$allowedTags[] = 'foo';

// `foo` attribute
Kirby\Sane\Svg::$allowedAttrs[] = 'foo';
```