jamesmartin / inline_svg

Embed SVG documents in your Rails views and style them with CSS
MIT License
716 stars 73 forks source link

Escape filename to avoid XSS from malicious input #117

Closed pbyrne closed 4 years ago

pbyrne commented 4 years ago

Because:

Solution:

pbyrne commented 4 years ago

Thanks for the 👍, @jamesmartin! Wondering when this could be merged and a new release pushed.

jamesmartin commented 4 years ago

Sorry it the delay, @pbyrne. I've merged your PR and will make a new release later this week.

jamesmartin commented 4 years ago

Actually, it looks like your change isn't backwards compatible with Rails 3:

ActionView::Template::Error: undefined method `html_escape_once' for ERB::Util:Module
89
  Did you mean?  html_escape

We'll probably need a conditional to check for that. The good news is that we'll be dropping Rails 3 support in Version 2 of this gem, but for now we've got to support it.