We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad754f1 commit 0a0a6ddCopy full SHA for 0a0a6dd
ruby/ql/src/experimental/cwe-176/examples/unicode_normalization.rb
@@ -1,7 +1,9 @@
1
+require "erb"
2
+
3
class UnicodeNormalizationHtMLSafeController < ActionController::Base
4
def unicodeNormalize
5
unicode_input = params[:unicode_input]
- unicode_html_safe = CGI.escapeHTML(unicode_input).html_safe
6
+ unicode_html_safe = ERB::Util.html_escape(unicode_input)
7
normalized_nfkc = unicode_html_safe.unicode_normalize(:nfkc) # $result=BAD
8
normalized_nfc = unicode_html_safe.unicode_normalize(:nfc) # $result=BAD
9
end
0 commit comments