Skip to content

Reference

phil/svg-sanitizer
TypeRole
Phil\SvgSanitizer\SvgSanitizerSanitizes an image against a policy; SVG_NAMESPACE, the namespace of SVG
Phil\SvgSanitizer\PolicyThe elements, attributes, link schemes, raster images, CSS policy and limits allowed; the lists as constants
Phil\SvgSanitizer\SanitizedThe result: the SVG, the first MAX_REMOVALS removals and the count of the others; isClean(), isRefused()
Phil\SvgSanitizer\RemovalA part removed: its reason, subject and line
Phil\SvgSanitizer\RemovalReasonWhy a part was removed or the image refused; describe(), refusesWhole()
Phil\SvgSanitizer\Validator\SafeSvgThe constraint: an SVG image kept whole
Phil\SvgSanitizer\Validator\SafeSvgValidatorEach removal a violation, a refused image one
Phil\SvgSanitizer\Exception\SvgSanitizerExceptionImplemented by every exception of the library
Phil\SvgSanitizer\Exception\InvalidPolicyA policy asked for what is never allowed, or given a limit below 1
Constant of PolicyHolds
DEFAULT_ELEMENTS, DEFAULT_ATTRIBUTESWhat new Policy() allows
DENIED_ELEMENTS, DENIED_SCHEMESWhat is never allowed, in lower case
ANIMATION_ELEMENTS, ANIMATION_ATTRIBUTESWhat withAnimations() adds
PRESENTATION_ATTRIBUTESThe attributes read as CSS when they hold more than names, numbers and colours
CSS_PROPERTIESThe properties of SVG the default CSS policy adds to a page's
DEFAULT_LINK_SCHEMEShttp, https, mailto

Phil\SvgSanitizer\Internal\Sanitization is internal: one image sanitized, never used on its own. Phil\SvgSanitizer\Internal\ScopedStyleSheet is internal too: the text of a <style> element held under the root.