LoginSignup
1
0

More than 3 years have passed since last update.

【Rails】エスケープ処理をControllerで行いたい(XSS対策)

Last updated at Posted at 2019-11-09
sample.rb
ERB::Util.h("<form> </form>")
#=> "&lt;form&gt; &lt;/form&gt;"

ERB::Util.html_escape("<form> </form>")
#=> "&lt;form&gt; &lt;/form&gt;"

上記の2つは全く同じ動きをします。

参考

module ERB::Util
RailsエンジニアのためのXSS入門

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0