selective-php / image-type

Image type (format) detection for PHP
MIT License
7 stars 4 forks source link

Enhance SVG check during infinite loop #1

Closed peter279k closed 5 years ago

peter279k commented 5 years ago

I found that it has the infinite loop for checking SVG.

The infinite loop I think it's not proper and I suggest we should set the SplFileObject::eof for the condition.

peter279k commented 5 years ago

@odan, I also found that the SVG image format is generated by XML document.

Perhaps the four bytes are always <svg, and we don't have to use the while loop.

odan commented 5 years ago

This should be fixed now.

peter279k commented 5 years ago

Good. I've looked at the new approach.

Thanks for your concern.