Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
c7554740
Commit
c7554740
authored
Feb 12, 2013
by
Holger Just
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove monkey patch which is already included in Rails 2.3.17 #1233
parent
3265c3fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
47 deletions
+0
-47
10-patches.rb
config/initializers/10-patches.rb
+0
-47
No files found.
config/initializers/10-patches.rb
View file @
c7554740
...
...
@@ -112,53 +112,6 @@ module ActionController
end
end
# Backported fix for CVE-2012-3464
# https://groups.google.com/d/msg/rubyonrails-security/kKGNeMrnmiY/r2yM7xy-G48J
# TODO: Remove this once we are on Rails >= 3.2.8
require
'active_support/core_ext/string/output_safety'
class
ERB
module
Util
HTML_ESCAPE
[
"'"
]
=
'''
if
RUBY_VERSION
>=
'1.9'
# A utility method for escaping HTML tag characters.
# This method is also aliased as <tt>h</tt>.
#
# In your ERB templates, use this method to escape any unsafe content. For example:
# <%=h @person.name %>
#
# ==== Example:
# puts html_escape("is a > 0 & a < 10?")
# # => is a > 0 & a < 10?
def
html_escape
(
s
)
s
=
s
.
to_s
if
s
.
html_safe?
s
else
s
.
gsub
(
/[&"'><]/
,
HTML_ESCAPE
).
html_safe
end
end
else
def
html_escape
(
s
)
#:nodoc:
s
=
s
.
to_s
if
s
.
html_safe?
s
else
s
.
gsub
(
/[&"'><]/n
)
{
|
special
|
HTML_ESCAPE
[
special
]
}.
html_safe
end
end
end
# Aliasing twice issues a warning "discarding old...". Remove first to avoid it.
remove_method
(
:h
)
alias
h
html_escape
module_function
:h
singleton_class
.
send
(
:remove_method
,
:html_escape
)
module_function
:html_escape
end
end
require
'action_view/helpers/tag_helper'
module
ActionView::Helpers::TagHelper
def
escape_once
(
html
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment