Escaping HTML in Rails

后端 未结 5 591
终归单人心
终归单人心 2021-02-01 04:12

What is the recommended way to escape HTML to prevent XSS vulnerabilities in Rails apps?

Should you allow the user to put any text into the database but escape it when d

5条回答
  •  花落未央
    2021-02-01 04:53

    Or with this plugin - no need for h 8)

    http://railspikes.com/2008/1/28/auto-escaping-html-with-rails

提交回复
热议问题