File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change
1
+ * Fix sanitizer vendor configuration in 7.1 defaults.
2
+
3
+ In apps where rails-html-sanitizer was not eagerly loaded, the sanitizer default could end up
4
+ being Rails::HTML4::Sanitizer when it should be set to Rails::HTML5::Sanitizer.
5
+
6
+ * Mike Dalessio* , * Rafael Mendonça França*
7
+
1
8
* Set ` action_mailer.default_url_options ` values in ` development ` and ` test ` .
2
9
3
10
Prior to this commit, new Rails applications would raise ` ActionView::Template::Error `
Original file line number Diff line number Diff line change @@ -310,14 +310,14 @@ def load_defaults(target_version)
310
310
active_support . raise_on_invalid_cache_expiration_time = true
311
311
end
312
312
313
- if defined? ( Rails :: HTML :: Sanitizer ) # nested ifs to avoid linter errors
314
- if respond_to? ( :action_view )
315
- action_view . sanitizer_vendor = Rails ::HTML ::Sanitizer . best_supported_vendor
316
- end
313
+ if respond_to? ( :action_view )
314
+ require "rails-html-sanitizer"
315
+ action_view . sanitizer_vendor = Rails ::HTML ::Sanitizer . best_supported_vendor
316
+ end
317
317
318
- if respond_to? ( :action_text )
319
- action_text . sanitizer_vendor = Rails :: HTML :: Sanitizer . best_supported_vendor
320
- end
318
+ if respond_to? ( :action_text )
319
+ require "rails-html-sanitizer"
320
+ action_text . sanitizer_vendor = Rails :: HTML :: Sanitizer . best_supported_vendor
321
321
end
322
322
when "7.2"
323
323
load_defaults "7.1"
You can’t perform that action at this time.
0 commit comments