Эх сурвалжийг харах

[ruby/agoo] Use CGI.escape_html (#10079)

For Rage this seems to be faster.
Petrik de Heus 1 долоо хоног өмнө
parent
commit
985c1a9c81

+ 1 - 1
frameworks/Ruby/agoo/app.rb

@@ -127,7 +127,7 @@ class FortunesHandler < BaseHandler
     f_2 = f_1.map(&:to_h).
             append({ 'id' => '0', 'message' => 'Additional fortune added at request time.' }).
               sort_by { |item| item['message'] }.
-                map { |f| "<tr><td>#{ f['id'] }</td><td>#{ Rack::Utils.escape_html(f['message']) }</td></tr>" }.
+                map { |f| "<tr><td>#{ f['id'] }</td><td>#{ CGI.escape_html(f['message']) }</td></tr>" }.
                   join
 
     html_response(<<-HTML)