cgi icon indicating copy to clipboard operation
cgi copied to clipboard

The class of `CGI.escapeHTML` result

Open nobu opened this issue 3 years ago • 0 comments

The class of CGI.escapeHTML result is not consistent for escaped/non-escaped cases.

require 'cgi/escape'
class S<String;end
p %w[a &].map {|c|[c, CGI.escapeHTML(S.new(c)).class]}.to_h #=> {"a"=>S, "&"=>String}

Probably, should be String always?

nobu avatar Dec 10 '21 06:12 nobu