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