actionpack 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## Rails 3.1.3 (unreleased) ##
|
2
|
+
|
3
|
+
* Downgrade sprockets to ~> 2.0.3. Using 2.1.0 caused regressions.
|
4
|
+
|
5
|
+
* Fix using `tranlate` helper with a html translation which uses the `:count` option for
|
6
|
+
pluralization.
|
7
|
+
|
8
|
+
*Jon Leighton*
|
9
|
+
|
1
10
|
## Rails 3.1.2 (unreleased) ##
|
2
11
|
|
3
12
|
* Fix XSS security vulnerability in the `translate` helper method. When using interpolation
|
data/lib/action_pack/version.rb
CHANGED
@@ -983,8 +983,16 @@ module ActionView
|
|
983
983
|
label_tag(name_and_id["id"], options, &block)
|
984
984
|
else
|
985
985
|
content = if text.blank?
|
986
|
+
object_name.gsub!(/\[(.*)_attributes\]\[\d\]/, '.\1')
|
986
987
|
method_and_value = tag_value.present? ? "#{method_name}.#{tag_value}" : method_name
|
987
|
-
|
988
|
+
|
989
|
+
if object.respond_to?(:to_model)
|
990
|
+
key = object.class.model_name.i18n_key
|
991
|
+
i18n_default = ["#{key}.#{method_and_value}".to_sym, ""]
|
992
|
+
end
|
993
|
+
|
994
|
+
i18n_default ||= ""
|
995
|
+
I18n.t("#{object_name}.#{method_and_value}", :default => i18n_default, :scope => "helpers.label").presence
|
988
996
|
else
|
989
997
|
text.to_s
|
990
998
|
end
|
@@ -48,7 +48,9 @@ module ActionView
|
|
48
48
|
if html_safe_translation_key?(key)
|
49
49
|
html_safe_options = options.dup
|
50
50
|
options.except(*I18n::RESERVED_KEYS).each do |name, value|
|
51
|
-
|
51
|
+
unless name == :count && value.is_a?(Numeric)
|
52
|
+
html_safe_options[name] = ERB::Util.html_escape(value.to_s)
|
53
|
+
end
|
52
54
|
end
|
53
55
|
translation = I18n.translate(scope_key_by_partial(key), html_safe_options)
|
54
56
|
|
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: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 3
|
10
|
+
version: 3.1.3
|
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-11-
|
18
|
+
date: 2011-11-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activesupport
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - "="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 5
|
30
30
|
segments:
|
31
31
|
- 3
|
32
32
|
- 1
|
33
|
-
-
|
34
|
-
version: 3.1.
|
33
|
+
- 3
|
34
|
+
version: 3.1.3
|
35
35
|
requirement: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: activemodel
|
@@ -42,12 +42,12 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - "="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 5
|
46
46
|
segments:
|
47
47
|
- 3
|
48
48
|
- 1
|
49
|
-
-
|
50
|
-
version: 3.1.
|
49
|
+
- 3
|
50
|
+
version: 3.1.3
|
51
51
|
requirement: *id002
|
52
52
|
- !ruby/object:Gem::Dependency
|
53
53
|
name: rack-cache
|
@@ -152,12 +152,12 @@ dependencies:
|
|
152
152
|
requirements:
|
153
153
|
- - ~>
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
hash:
|
155
|
+
hash: 9
|
156
156
|
segments:
|
157
157
|
- 2
|
158
|
-
- 1
|
159
158
|
- 0
|
160
|
-
|
159
|
+
- 3
|
160
|
+
version: 2.0.3
|
161
161
|
requirement: *id009
|
162
162
|
- !ruby/object:Gem::Dependency
|
163
163
|
name: erubis
|