actionpack 3.2.5 → 3.2.6
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.md +21 -0
- data/lib/action_controller/test_case.rb +1 -0
- data/lib/action_dispatch/http/request.rb +4 -2
- data/lib/action_dispatch/middleware/flash.rb +6 -3
- data/lib/action_dispatch/routing/polymorphic_routes.rb +7 -1
- data/lib/action_dispatch/testing/integration.rb +5 -2
- data/lib/action_pack/version.rb +1 -1
- data/lib/action_view/helpers/form_tag_helper.rb +6 -0
- data/lib/action_view/helpers/url_helper.rb +7 -2
- data/lib/action_view/test_case.rb +2 -1
- data/lib/sprockets/helpers/rails_helper.rb +2 -1
- metadata +10 -10
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
## Rails 3.2.6 (Jun 12, 2012) ##
|
2
|
+
|
3
|
+
* nil is removed from array parameter values
|
4
|
+
|
5
|
+
CVE-2012-2694
|
6
|
+
|
7
|
+
* Deprecate `:confirm` in favor of `':data => { :confirm => "Text" }'` option for `button_to`, `button_tag`, `image_submit_tag`, `link_to` and `submit_tag` helpers.
|
8
|
+
|
9
|
+
*Carlos Galdino*
|
10
|
+
|
11
|
+
* Allow to use mounted_helpers (helpers for accessing mounted engines) in ActionView::TestCase. *Piotr Sarnacki*
|
12
|
+
|
13
|
+
* Include mounted_helpers (helpers for accessing mounted engines) in ActionDispatch::IntegrationTest by default. *Piotr Sarnacki*
|
14
|
+
|
15
|
+
|
16
|
+
## Rails 3.2.5 (Jun 1, 2012) ##
|
17
|
+
|
18
|
+
* No changes.
|
19
|
+
|
20
|
+
|
1
21
|
## Rails 3.2.4 (May 31, 2012) ##
|
2
22
|
|
3
23
|
* Deprecate old APIs for highlight, excerpt and word_wrap *Jeremy Walker*
|
@@ -24,6 +44,7 @@
|
|
24
44
|
* Strip [nil] from parameters hash. Thanks to Ben Murphy for
|
25
45
|
reporting this! CVE-2012-2660
|
26
46
|
|
47
|
+
|
27
48
|
## Rails 3.2.3 (March 30, 2012) ##
|
28
49
|
|
29
50
|
* Allow to lazy load `default_form_builder` by passing a `String` instead of a constant. *Piotr Sarnacki*
|
@@ -460,6 +460,7 @@ module ActionController
|
|
460
460
|
|
461
461
|
@request.session = ActionController::TestSession.new(session) if session
|
462
462
|
@request.session["flash"] = @request.flash.update(flash || {})
|
463
|
+
@request.session["flash"].sweep
|
463
464
|
|
464
465
|
@controller.request = @request
|
465
466
|
build_request_uri(action, parameters)
|
@@ -251,17 +251,19 @@ module ActionDispatch
|
|
251
251
|
|
252
252
|
# Remove nils from the params hash
|
253
253
|
def deep_munge(hash)
|
254
|
+
keys = hash.keys.find_all { |k| hash[k] == [nil] }
|
255
|
+
keys.each { |k| hash[k] = nil }
|
256
|
+
|
254
257
|
hash.each_value do |v|
|
255
258
|
case v
|
256
259
|
when Array
|
257
260
|
v.grep(Hash) { |x| deep_munge(x) }
|
261
|
+
v.compact!
|
258
262
|
when Hash
|
259
263
|
deep_munge(v)
|
260
264
|
end
|
261
265
|
end
|
262
266
|
|
263
|
-
keys = hash.keys.find_all { |k| hash[k] == [nil] }
|
264
|
-
keys.each { |k| hash[k] = nil }
|
265
267
|
hash
|
266
268
|
end
|
267
269
|
|
@@ -4,7 +4,7 @@ module ActionDispatch
|
|
4
4
|
# read a notice you put there or <tt>flash["notice"] = "hello"</tt>
|
5
5
|
# to put a new one.
|
6
6
|
def flash
|
7
|
-
@env[Flash::KEY] ||= (session["flash"] || Flash::FlashHash.new)
|
7
|
+
@env[Flash::KEY] ||= (session["flash"] || Flash::FlashHash.new)
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -235,6 +235,10 @@ module ActionDispatch
|
|
235
235
|
end
|
236
236
|
|
237
237
|
def call(env)
|
238
|
+
if (session = env['rack.session']) && (flash = session['flash'])
|
239
|
+
flash.sweep
|
240
|
+
end
|
241
|
+
|
238
242
|
@app.call(env)
|
239
243
|
ensure
|
240
244
|
session = env['rack.session'] || {}
|
@@ -251,8 +255,7 @@ module ActionDispatch
|
|
251
255
|
env[KEY] = new_hash
|
252
256
|
end
|
253
257
|
|
254
|
-
if
|
255
|
-
session.key?('flash') && session['flash'].empty?
|
258
|
+
if session.key?('flash') && session['flash'].empty?
|
256
259
|
session.delete('flash')
|
257
260
|
end
|
258
261
|
end
|
@@ -97,7 +97,7 @@ module ActionDispatch
|
|
97
97
|
end
|
98
98
|
|
99
99
|
record = extract_record(record_or_hash_or_array)
|
100
|
-
record = record
|
100
|
+
record = convert_to_model(record)
|
101
101
|
|
102
102
|
args = Array === record_or_hash_or_array ?
|
103
103
|
record_or_hash_or_array.dup :
|
@@ -124,6 +124,8 @@ module ActionDispatch
|
|
124
124
|
args.last.kind_of?(Hash) ? args.last.merge!(url_options) : args << url_options
|
125
125
|
end
|
126
126
|
|
127
|
+
args.collect! { |a| convert_to_model(a) }
|
128
|
+
|
127
129
|
(proxy || self).send(named_route, *args)
|
128
130
|
end
|
129
131
|
|
@@ -154,6 +156,10 @@ module ActionDispatch
|
|
154
156
|
options[:action] ? "#{options[:action]}_" : ''
|
155
157
|
end
|
156
158
|
|
159
|
+
def convert_to_model(object)
|
160
|
+
object.respond_to?(:to_model) ? object.to_model : object
|
161
|
+
end
|
162
|
+
|
157
163
|
def routing_type(options)
|
158
164
|
options[:routing_type] || :url
|
159
165
|
end
|
@@ -177,8 +177,11 @@ module ActionDispatch
|
|
177
177
|
|
178
178
|
# If the app is a Rails app, make url_helpers available on the session
|
179
179
|
# This makes app.url_for and app.foo_path available in the console
|
180
|
-
if app.respond_to?(:routes)
|
181
|
-
singleton_class.class_eval
|
180
|
+
if app.respond_to?(:routes)
|
181
|
+
singleton_class.class_eval do
|
182
|
+
include app.routes.url_helpers if app.routes.respond_to?(:url_helpers)
|
183
|
+
include app.routes.mounted_helpers if app.routes.respond_to?(:mounted_helpers)
|
184
|
+
end
|
182
185
|
end
|
183
186
|
|
184
187
|
reset!
|
data/lib/action_pack/version.rb
CHANGED
@@ -423,6 +423,8 @@ module ActionView
|
|
423
423
|
end
|
424
424
|
|
425
425
|
if confirm = options.delete("confirm")
|
426
|
+
ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead"
|
427
|
+
|
426
428
|
options["data-confirm"] = confirm
|
427
429
|
end
|
428
430
|
|
@@ -475,6 +477,8 @@ module ActionView
|
|
475
477
|
end
|
476
478
|
|
477
479
|
if confirm = options.delete("confirm")
|
480
|
+
ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead"
|
481
|
+
|
478
482
|
options["data-confirm"] = confirm
|
479
483
|
end
|
480
484
|
|
@@ -510,6 +514,8 @@ module ActionView
|
|
510
514
|
options = options.stringify_keys
|
511
515
|
|
512
516
|
if confirm = options.delete("confirm")
|
517
|
+
ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead"
|
518
|
+
|
513
519
|
options["data-confirm"] = confirm
|
514
520
|
end
|
515
521
|
|
@@ -628,8 +628,13 @@ module ActionView
|
|
628
628
|
html_options["data-disable-with"] = disable_with
|
629
629
|
end
|
630
630
|
|
631
|
-
|
632
|
-
|
631
|
+
if confirm
|
632
|
+
ActiveSupport::Deprecation.warn ":confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => \'Text\' }' instead"
|
633
|
+
|
634
|
+
html_options["data-confirm"] = confirm
|
635
|
+
end
|
636
|
+
|
637
|
+
add_method_to_attributes!(html_options, method) if method
|
633
638
|
|
634
639
|
html_options
|
635
640
|
else
|
@@ -229,7 +229,8 @@ module ActionView
|
|
229
229
|
|
230
230
|
def method_missing(selector, *args)
|
231
231
|
if @controller.respond_to?(:_routes) &&
|
232
|
-
@controller._routes.named_routes.helpers.include?(selector)
|
232
|
+
( @controller._routes.named_routes.helpers.include?(selector) ||
|
233
|
+
@controller._routes.mounted_helpers.method_defined?(selector) )
|
233
234
|
@controller.__send__(selector, *args)
|
234
235
|
else
|
235
236
|
super
|
@@ -157,7 +157,8 @@ module Sprockets
|
|
157
157
|
def rewrite_extension(source, dir, ext)
|
158
158
|
source_ext = File.extname(source)
|
159
159
|
if ext && source_ext != ".#{ext}"
|
160
|
-
if !source_ext.empty? && asset_environment[source]
|
160
|
+
if !source_ext.empty? && (asset = asset_environment[source]) &&
|
161
|
+
asset.pathname.to_s =~ /#{source}\Z/
|
161
162
|
source
|
162
163
|
else
|
163
164
|
"#{source}.#{ext}"
|
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: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 3.2.
|
9
|
+
- 6
|
10
|
+
version: 3.2.6
|
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: 2012-06-
|
18
|
+
date: 2012-06-12 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: 3
|
29
29
|
segments:
|
30
30
|
- 3
|
31
31
|
- 2
|
32
|
-
-
|
33
|
-
version: 3.2.
|
32
|
+
- 6
|
33
|
+
version: 3.2.6
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -41,12 +41,12 @@ dependencies:
|
|
41
41
|
requirements:
|
42
42
|
- - "="
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
44
|
+
hash: 3
|
45
45
|
segments:
|
46
46
|
- 3
|
47
47
|
- 2
|
48
|
-
-
|
49
|
-
version: 3.2.
|
48
|
+
- 6
|
49
|
+
version: 3.2.6
|
50
50
|
type: :runtime
|
51
51
|
version_requirements: *id002
|
52
52
|
- !ruby/object:Gem::Dependency
|