File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def self.call(_req)
127127 f_2 = f_1 . map ( &:to_h ) .
128128 append ( { 'id' => '0' , 'message' => 'Additional fortune added at request time.' } ) .
129129 sort_by { |item | item [ 'message' ] } .
130- map { |f | "<tr><td>#{ f [ 'id' ] } </td><td>#{ CGI . escape_html ( f [ 'message' ] ) } </td></tr>" } .
130+ map { |f | "<tr><td>#{ f [ 'id' ] } </td><td>#{ ERB :: Escape . html_escape ( f [ 'message' ] ) } </td></tr>" } .
131131 join
132132
133133 html_response ( <<-HTML )
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ def fortunes
7070 html << <<~"HTML"
7171 < tr >
7272 < td > #{ fortune . id } </ td>
73- < td > #{ CGI . escape_html ( fortune . message ) } </ td>
73+ < td > #{ ERB :: Escape . html_escape ( fortune . message ) } </ td>
7474 </ tr>
7575 HTML
7676 end
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def fortunes
5858 buffer << TEMPLATE_PREFIX
5959
6060 fortunes . each do |item |
61- buffer << "<tr><td>#{ item [ :id ] } </td><td>#{ Rack :: Utils . escape_html ( item [ :message ] ) } </td></tr>"
61+ buffer << "<tr><td>#{ item [ :id ] } </td><td>#{ ERB :: Escape . html_escape ( item [ :message ] ) } </td></tr>"
6262 end
6363 buffer << TEMPLATE_POSTFIX
6464 end
Original file line number Diff line number Diff line change 66<% @fortunes . each do |fortune | %>
77< tr >
88 < td > <%= fortune . id %> </ td >
9- < td > <%= CGI . escape_html ( fortune . message ) %> </ td >
9+ < td > <%= ERB :: Escape . html_escape ( fortune . message ) %> </ td >
1010</ tr >
1111<% end %>
1212</ table >
Original file line number Diff line number Diff line change 66<% @fortunes . each do |fortune | %>
77< tr >
88 < td > <%= fortune . id %> </ td >
9- < td > <%= CGI . escape_html ( fortune . message ) %> </ td >
9+ < td > <%= ERB :: Escape . html_escape ( fortune . message ) %> </ td >
1010</ tr >
1111<% end %>
1212</ table >
You can’t perform that action at this time.
0 commit comments