actionpack 2.3.12 → 2.3.14
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +2 -2
- data/Rakefile +1 -1
- data/lib/action_controller/response.rb +2 -1
- data/lib/action_controller/vendor/html-scanner/html/node.rb +1 -1
- data/lib/action_pack/version.rb +1 -1
- data/test/controller/content_type_test.rb +10 -0
- data/test/controller/html-scanner/sanitizer_test.rb +7 -0
- metadata +8 -8
data/CHANGELOG
CHANGED
@@ -1935,7 +1935,7 @@ superclass' view_paths. [Rick Olson]
|
|
1935
1935
|
|
1936
1936
|
* Update documentation for erb trim syntax. #5651 [matt@mattmargolis.net]
|
1937
1937
|
|
1938
|
-
* Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com
|
1938
|
+
* Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com]
|
1939
1939
|
|
1940
1940
|
* Reset @html_document between requests so assert_tag works. #4810 [Jarkko Laine, easleydp@gmail.com]
|
1941
1941
|
|
@@ -2532,7 +2532,7 @@ superclass' view_paths. [Rick Olson]
|
|
2532
2532
|
|
2533
2533
|
* Provide support for decimal columns to form helpers. Closes #5672. [Dave Thomas]
|
2534
2534
|
|
2535
|
-
* Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com
|
2535
|
+
* Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com]
|
2536
2536
|
|
2537
2537
|
* Reset @html_document between requests so assert_tag works. #4810 [Jarkko Laine, easleydp@gmail.com]
|
2538
2538
|
|
data/Rakefile
CHANGED
@@ -78,7 +78,7 @@ spec = Gem::Specification.new do |s|
|
|
78
78
|
|
79
79
|
s.requirements << 'none'
|
80
80
|
|
81
|
-
s.add_dependency('activesupport', '= 2.3.
|
81
|
+
s.add_dependency('activesupport', '= 2.3.14' + PKG_BUILD)
|
82
82
|
s.add_dependency('rack', '~> 1.1.0')
|
83
83
|
|
84
84
|
s.require_path = 'lib'
|
@@ -64,12 +64,13 @@ module ActionController # :nodoc:
|
|
64
64
|
# the character set information will also be included in the content type
|
65
65
|
# information.
|
66
66
|
def content_type=(mime_type)
|
67
|
-
|
67
|
+
new_content_type =
|
68
68
|
if mime_type =~ /charset/ || (c = charset).nil?
|
69
69
|
mime_type.to_s
|
70
70
|
else
|
71
71
|
"#{mime_type}; charset=#{c}"
|
72
72
|
end
|
73
|
+
self.headers["Content-Type"] = URI.escape(new_content_type, "\r\n")
|
73
74
|
end
|
74
75
|
|
75
76
|
# Returns the response's content MIME type, or nil if content type has been set.
|
@@ -162,7 +162,7 @@ module HTML #:nodoc:
|
|
162
162
|
end
|
163
163
|
|
164
164
|
closing = ( scanner.scan(/\//) ? :close : nil )
|
165
|
-
return Text.new(parent, line, pos, content) unless name = scanner.scan(/[
|
165
|
+
return Text.new(parent, line, pos, content) unless name = scanner.scan(/[^\s!>\/]+/)
|
166
166
|
name.downcase!
|
167
167
|
|
168
168
|
unless closing
|
data/lib/action_pack/version.rb
CHANGED
@@ -46,6 +46,11 @@ class ContentTypeController < ActionController::Base
|
|
46
46
|
format.rss { render :text => "hello world!", :content_type => Mime::XML }
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
def render_content_type_from_user_input
|
51
|
+
response.content_type= params[:hello]
|
52
|
+
render :text=>"hello"
|
53
|
+
end
|
49
54
|
|
50
55
|
def rescue_action(e) raise end
|
51
56
|
end
|
@@ -129,6 +134,11 @@ class ContentTypeTest < ActionController::TestCase
|
|
129
134
|
assert_equal Mime::HTML, @response.content_type
|
130
135
|
assert_equal "utf-8", @response.charset
|
131
136
|
end
|
137
|
+
|
138
|
+
def test_user_supplied_value
|
139
|
+
get :render_content_type_from_user_input, :hello=>"hello/world\r\nAttack: true"
|
140
|
+
assert_equal "hello/world%0D%0AAttack: true", @response.content_type
|
141
|
+
end
|
132
142
|
end
|
133
143
|
|
134
144
|
class AcceptBasedContentTypeTest < ActionController::TestCase
|
@@ -5,6 +5,13 @@ class SanitizerTest < ActionController::TestCase
|
|
5
5
|
@sanitizer = nil # used by assert_sanitizer
|
6
6
|
end
|
7
7
|
|
8
|
+
def test_strip_tags_with_quote
|
9
|
+
sanitizer = HTML::FullSanitizer.new
|
10
|
+
string = '<" <img src="trollface.gif" onload="alert(1)"> hi'
|
11
|
+
|
12
|
+
assert_equal ' hi', sanitizer.sanitize(string)
|
13
|
+
end
|
14
|
+
|
8
15
|
def test_strip_tags
|
9
16
|
sanitizer = HTML::FullSanitizer.new
|
10
17
|
assert_equal("<<<bad html", sanitizer.sanitize("<<<bad html"))
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 2.3.
|
9
|
+
- 14
|
10
|
+
version: 2.3.14
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Heinemeier Hansson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-16 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activesupport
|
@@ -25,12 +25,12 @@ dependencies:
|
|
25
25
|
requirements:
|
26
26
|
- - "="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 31
|
29
29
|
segments:
|
30
30
|
- 2
|
31
31
|
- 3
|
32
|
-
-
|
33
|
-
version: 2.3.
|
32
|
+
- 14
|
33
|
+
version: 2.3.14
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -527,7 +527,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
527
527
|
requirements:
|
528
528
|
- none
|
529
529
|
rubyforge_project: actionpack
|
530
|
-
rubygems_version: 1.8.
|
530
|
+
rubygems_version: 1.8.8
|
531
531
|
signing_key:
|
532
532
|
specification_version: 3
|
533
533
|
summary: Web-flow and rendering framework putting the VC in MVC.
|