darylldoyle / svg-sanitizer

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

Fix a PHP 8 deprecation warning #45

Closed angrybrad closed 3 years ago

angrybrad commented 3 years ago

https://php.watch/versions/8.0/libxml_disable_entity_loader-deprecation

angrybrad commented 3 years ago

@darylldoyle good question. Looks like they recommend either way: https://php.watch/versions/8.0#libxml_disable_entity_loader-deprecation

Not sure how many people would compile PHP with an older version of libxml than 2.9.0, but happy to update to this instead:

if (\LIBXML_VERSION < 20900) {
    libxml_disable_entity_loader(true);
}
darylldoyle commented 3 years ago

Thanks, @angrybrad! I think I'd feel more comfortable targeting the libxml version directly, rather than the PHP version. If you don't mind making that change when you get time, I'll be happy to merge this in 🙂

angrybrad commented 3 years ago

@darylldoyle done!

darylldoyle commented 3 years ago

Thanks @angrybrad that's great. I appreciate you taking the time to make this PR. I'll get an update for a new version out shortly!