mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-07-12 23:00:55 +02:00
Fix false-positive SVG detections
This commit is contained in:
@ -7,6 +7,7 @@
|
|||||||
- (pro) Add [gradient](https://docs.imgproxy.net/latest/generating_the_url?id=gradient) processing option.
|
- (pro) Add [gradient](https://docs.imgproxy.net/latest/generating_the_url?id=gradient) processing option.
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix false-positive SVG detections.
|
||||||
- (pro) Fix saving of GIF with variable frame delay to MP4.
|
- (pro) Fix saving of GIF with variable frame delay to MP4.
|
||||||
|
|
||||||
## [3.9.0] - 2022-10-19
|
## [3.9.0] - 2022-10-19
|
||||||
|
@ -20,12 +20,13 @@ func IsSVG(r io.Reader) (bool, error) {
|
|||||||
|
|
||||||
switch tt {
|
switch tt {
|
||||||
case xml.ErrorToken:
|
case xml.ErrorToken:
|
||||||
|
if err := l.Err(); err != io.EOF {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
|
|
||||||
case xml.StartTagToken:
|
case xml.StartTagToken:
|
||||||
if strings.ToLower(string(l.Text())) == "svg" {
|
return strings.ToLower(string(l.Text())) == "svg", nil
|
||||||
return true, nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user