bluerail / twitter-bootstrap-rails-confirm

Confirm dialogs using Twitter Bootstrap
https://bluerail.nl
MIT License
85 stars 34 forks source link

Attributes are not made html safe #11

Closed mbrookes closed 11 years ago

mbrookes commented 11 years ago

Consider the attribute:

data: { confirm: "Are you sure? The page <strong>#{page.title}</strong> will be permanently deleted." }

For the page.title (which may be user input) of <script>alert('Boo!')</script> a javascript alert is raised.

rvanlieshout commented 11 years ago

I don't think this gem should decide if it should be made html safe or not. If you want to use a safe version of page.title you could use $(page.title).text().