Closed werew01f closed 8 years ago
What are you wanting to validate?
SVGs aren't really images so what you should validate is probably XML via XSD.
i want use imageValidation for png, jpeg and other image files such as svg. i know thats SVG aren't images at all, but its kind of image-type file, so i think that imageValidation should forks for it. Just valid svg or not.
Yes, uploaded SVGs should be validated and probably sanitized. Not sure it should be part of the core image validator though...
Treating svg like regular images will create lot of problems and potential security issues. If I allow users to upload images I would not expect that I need to protect against XSS in uploaded files.
Agree. I'd prefer it as a separate component.
What steps will reproduce the problem?
ImageValidator validateImage always fail for svg file
What is the expected result?
SVG is scalable image type, but structured as XML. I think that image validator should correct validate SVG graphic files.
What do you get instead?
Problem in https://github.com/yiisoft/yii2/blob/master/framework/validators/ImageValidator.php#L133 getimagesize always fails for svg.
Additional info