Forum: Ruby on Rails Escaping Data to Prevent XSS When It Gets Stored

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1e91cc63dfdcb67ebb94dd0abbc66ed4?d=identicon&s=25 mh (Guest)
on 2007-07-23 21:37
(Received via mailing list)
It seems to me that escaping data about to appear in a view in an
rhtml template using h / html_escape is further downstream than you
really want to be escaping certain data.  Wouldn't it make more sense
to escape data *before* you store it in the database?  This way any
code that subsequently picks up the data doesn't have to worry,
correct?  Has anyone done this?  Is there a reason you *wouldn't* want
to escape the data prior storage?
This topic is locked and can not be replied to.