Sanitizereasy_svg_sanitizer_is_current()

easy_svg_sanitizer_is_current()

Tells whether the loaded sanitizer class is the version this plugin ships.

Function · Easy SVG · Status: Internal · Defined in easy-svg.php

Internal: not part of the promised public surface. It may change without notice.

Usage

easy_svg_sanitizer_is_current( string $class = '\\enshrined\\svgSanitize\\Sanitizer' ): bool

Example

if ( ! easy_svg_sanitizer_is_current() ) {
	error_log( 'Easy SVG: an outdated sanitizer is loaded.' );
}

Description

Composer classes are global, so another plugin bundling an older enshrined/svg-sanitize can win the autoloader. The check is that the class exists and has removeDoctype(), which only 1.0.0 and later have.

Parameters

body
$classstring

Class to check. Injectable for tests.

Return value

returnbool

True when the class is 1.0.0 or later.