Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive - Unescaped model attribute #1151

Closed
johnnyshields opened this issue Jan 18, 2018 · 1 comment
Closed

False positive - Unescaped model attribute #1151

johnnyshields opened this issue Jan 18, 2018 · 1 comment

Comments

@johnnyshields
Copy link

False Positive

The view calls a helper function which escapes the variable

# view
<%= t(:my_translation, timeago: timeago(user.created_at)) %>

# helper
   def timeago(time)
     return unless time
     content_tag(:span, I18n.l(time))
   end
  | -Site Scripting | Unescaped model attribute near line 15: t(:added_by, :time_ago => timeago(Account.new.created_at))
@presidentbeef
Copy link
Owner

Hi Johnny,

What version of Rails is this? Don't you have autoescaping enabled?

Repository owner locked and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants