2016/08/12分のコミットです。
CHANGELOGへの追加はありませんでした。
Creating a new Topic class instead of class_eval for the existing one
activerecord/test/cases/validations_test.rb
の修正です。
numericality validationのテストで、既存のTopic
クラスにattribute、validationを追加していたのを、別に新規でTopic
クラスを作成するよう修正しています。
- Topic.class_eval do + klass = Class.new(Topic) do
既存のTopic
クラスを拡張すると、他のテストに影響が出てしまう為、との事です。
ensure tag/content_tag escapes " in attribute vals
actionview/lib/action_view/helpers/tag_helper.rb
の修正です。
tag
/ content_tag
でhtmlを生成する際に、attribute value内の"
(ダブルクォート)をエスケープするよう修正しています。
# before content_tag(:div, "foo", title: sanitize('" onmouseover="alert(1);//')) => "<div title=\"\" onmouseover=\"alert(1);//\">foo</div>" # after content_tag(:div, "foo", title: sanitize('" onmouseover="alert(1);//')) #=> "<div title=\"" onmouseover="alert(1);//\">foo</div>"
ダブルクォートそのままだとXSSに使われてしまう可能性がある為との事です。CVE-2016-6316。
Fix warning: ambiguous first argument
activerecord/test/cases/scoping/relation_scoping_test.rb
の修正です。
merge optionのテストでambiguous first argument
のwarningが出ていたので、()
を追加し対応しています。
Integration test to prevent regression for the 5th time
railties/test/json_params_parsing_test.rb
の修正です。
parameterのformatがJSONだった場合に、null queryが実行されない事を確認する為のテストを追加しています。
Rails 5系には影響が無い為masterに修正のコミットは無いのですが、4.2系でparameterのnilチェックに誤りがあり、DBへのqueryに"IS NULL"やwhereに空文字を指定していまう事があるバグ(CVE-2016-6317)があり、問題が無い事を確認する為に、テストのみ追加しています。
Merge pull request #26118 from alexcameron89/param-encoding-documentation
actionpack/lib/action_controller/metal/parameter_encoding.rb
のdocの修正です。
ActionController::ActionController
moduleにdocを追加しています。
Merge pull request #26125 from qinix/fix-doc
rails guideのAction Cable Overview
の修正です。
broadcasting nameに誤りがあったのを修正、及びPassing Parameters to Channels
の項のexampleコードで、使用するメソッドに誤りがあったのを修正していまs.
Ensure values are strings before calling gsub
actionview/lib/action_view/helpers/tag_helper.rb
の修正です。
ActionView::Helpers::TagHelper::TagBuilder#tag_option
メソッドでvalueの`"
(ダブルクォート)をエスケープする前に、to_s
でStringに変換してから処理を行うよう修正しています。valueがSymbolやIntegerだった場合にエラーになってしまう為。