darylldoyle / svg-sanitizer

A PHP SVG/XML Sanitizer
GNU General Public License v2.0
454 stars 67 forks source link

[BUGFIX] Restore libxml error handler and clear errors #90

Closed lolli42 closed 4 months ago

lolli42 commented 1 year ago

When using libxml_use_internal_errors(true), errors pile up in an internal error handler. When not resetting errors using libxml_clear_errors(), subsequent libxml usages may fail.

The patch properly restores the previous libxml error handler value and clears errors.