Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frameworks/Ruby/agoo/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def self.call(_req)
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>#{ CGI.escape_html(f['message']) }</td></tr>" }.
map { |f| "<tr><td>#{ f['id'] }</td><td>#{ ERB::Escape.html_escape(f['message']) }</td></tr>" }.
join

html_response(<<-HTML)
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/rack-sequel/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def fortunes
html << <<~"HTML"
<tr>
<td>#{fortune.id}</td>
<td>#{CGI.escape_html(fortune.message)}</td>
<td>#{ERB::Escape.html_escape(fortune.message)}</td>
</tr>
HTML
end
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/rack/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def fortunes
buffer << TEMPLATE_PREFIX

fortunes.each do |item|
buffer << "<tr><td>#{item[:id]}</td><td>#{Rack::Utils.escape_html(item[:message])}</td></tr>"
buffer << "<tr><td>#{item[:id]}</td><td>#{ERB::Escape.html_escape(item[:message])}</td></tr>"
end
buffer << TEMPLATE_POSTFIX
end
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/sinatra-sequel/views/fortunes.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% @fortunes.each do |fortune| %>
<tr>
<td><%= fortune.id %></td>
<td><%= CGI.escape_html(fortune.message) %></td>
<td><%= ERB::Escape.html_escape(fortune.message) %></td>
</tr>
<% end %>
</table>
2 changes: 1 addition & 1 deletion frameworks/Ruby/sinatra/views/fortunes.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<% @fortunes.each do |fortune| %>
<tr>
<td><%= fortune.id %></td>
<td><%= CGI.escape_html(fortune.message) %></td>
<td><%= ERB::Escape.html_escape(fortune.message) %></td>
</tr>
<% end %>
</table>
Loading