From fbb3e8ec136c08e3ff4aab5981a2297771728836 Mon Sep 17 00:00:00 2001 From: Ryunosuke SATO Date: Sat, 5 Jan 2013 00:50:06 +0900 Subject: [PATCH] Remove unnecessary `ERB::Util::h` It is automatically applied when strings is unsafe for html. --- .../templates/rescues/_request_and_response.erb | 6 +++--- .../middleware/templates/rescues/_trace.erb | 2 +- .../middleware/templates/rescues/diagnostics.erb | 6 +++--- .../templates/rescues/missing_template.erb | 2 +- .../middleware/templates/rescues/routing_error.erb | 4 ++-- .../middleware/templates/rescues/template_error.erb | 12 ++++++------ .../middleware/templates/rescues/unknown_action.erb | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb index 035f08d2f4..ab24118f3e 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb @@ -2,7 +2,7 @@ <% if (hide = @exception.blamed_files.length > 8) %> Toggle blamed files <% end %> -
><%=h @exception.describe_blame %>
+
><%= @exception.describe_blame %>
<% end %> <% @@ -18,7 +18,7 @@ %>

Request

-

Parameters:

<%=h request_dump %>
+

Parameters:

<%= request_dump %>
@@ -31,4 +31,4 @@

Response

-

Headers:

<%=h defined?(@response) ? @response.headers.inspect.gsub(',', ",\n") : 'None' %>
+

Headers:

<%= defined?(@response) ? @response.headers.inspect.gsub(',', ",\n") : 'None' %>
diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb index 463ca39563..9d947aea40 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb @@ -20,7 +20,7 @@ <% traces.each do |name, trace| %>
;"> -
<%=h trace.join "\n" %>
+
<%= trace.join "\n" %>
<% end %> diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb index 1c6b5010a3..57a2940802 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb @@ -1,14 +1,14 @@

- <%=h @exception.class.to_s %> + <%= @exception.class.to_s %> <% if @request.parameters['controller'] %> - in <%=h @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%=h @request.parameters['action'] %><% end %> + in <%= @request.parameters['controller'].camelize %>Controller<% if @request.parameters['action'] %>#<%= @request.parameters['action'] %><% end %> <% end %>

-

<%=h @exception.message %>

+

<%= @exception.message %>

<%= render template: "rescues/_source" %> <%= render template: "rescues/_trace" %> diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb index c5917b9acb..ca14215946 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb @@ -3,5 +3,5 @@
-

<%=h @exception.message %>

+

<%= @exception.message %>

diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb index ca85e6d048..77804a8cbb 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb @@ -2,13 +2,13 @@

Routing Error

-

<%=h @exception.message %>

+

<%= @exception.message %>

<% unless @exception.failures.empty? %>

Failure reasons:

    <% @exception.failures.each do |route, reason| %> -
  1. <%=h route.inspect.gsub('\\', '') %> failed because <%=h reason.downcase %>
  2. +
  3. <%= route.inspect.gsub('\\', '') %> failed because <%= reason.downcase %>
  4. <% end %>

diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb index 9f3816bf40..63216ef7c5 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb @@ -1,20 +1,20 @@ <% @source_extract = @exception.source_extract(0, :html) %>

- <%=h @exception.original_exception.class.to_s %> in - <%=h @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%=h @request.parameters["action"] %> + <%= @exception.original_exception.class.to_s %> in + <%= @request.parameters["controller"].capitalize if @request.parameters["controller"]%>#<%= @request.parameters["action"] %>

- Showing <%=h @exception.file_name %> where line #<%=h @exception.line_number %> raised: + Showing <%= @exception.file_name %> where line #<%= @exception.line_number %> raised:

-
<%=h @exception.message %>
+
<%= @exception.message %>
-

Extracted source (around line #<%=h @exception.line_number %>):

+

Extracted source (around line #<%= @exception.line_number %>):

@@ -36,7 +36,7 @@ -

<%=h @exception.sub_template_message %>

+

<%= @exception.sub_template_message %>

<%= render template: "rescues/_trace" %> <%= render template: "rescues/_request_and_response" %> diff --git a/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb b/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb index 0ed1b188c1..c1fbf67eed 100644 --- a/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb +++ b/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb @@ -2,5 +2,5 @@

Unknown action

-

<%=h @exception.message %>

+

<%= @exception.message %>