New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
white_list_sanitizer is deprecated #36858
Comments
Can you try with 6-0-stable? Should be fixed there. |
fixed with this commit |
Yeah, that's the one! I've backported it to 5-2-stable as well: 2cd4bce |
Will the 5.2 backport be released soon? We'd like to have deprecations |
For anyone wondering what's going on, rails_html_sanitizer deprecated It appears to be a simple name change to safe_list_sanitizer, no functionality change. rails/rails-html-sanitizer#87 So if you upgrade the When the deprecated method name is being called by Rails itself (as it is by simple_format), the only way to avoid the deprecation is to: a) Update to a new version of Rails (which do not yet exist at present) that does not call the deprecated method name (not sure if a 5.2 release will be made that does so. Older versions probably not? Might require a 6.0 upgrade) b) Don't use c) Wrap all calls to |
Hey! Sorry about all the fuss here. I screwed up the 1.1.0 release. Rails 5.2 was never meant to trigger deprecation warnings. I've just released rails-html-sanitizer 1.2.0 that removes the deprecation warnings for Rails 5.2 (Rails 6 apps will just require >= 1.2.0 and use the new API directly). If there's more issues, please open a new issue so it won't end up lost in here for others. If someone wants to confirm that it works for them, feel free to comment directly here. Thanks everyone and sorry for all the confusion ❤️ |
I can confirm that the new version worked! Thank you! ❤️ Full fix:
|
The recent update to v1.1.0 of rails_html_sanitizer means that rspec is raising lots of deprecation warnings. This is a bug in that version and and is resolved by updating to v1.2.0. See issue here: rails/rails#36858
The recent update to v1.1.0 of rails_html_sanitizer means that rspec is raising lots of deprecation warnings. This is a bug in that version and and is resolved by updating to v1.2.0. See issue here: rails/rails#36858
We have started to see deprecation warnings whilst running specs, specifically "DEPRECATION WARNING: warning: white_list_sanitizer isdeprecated, please use safe_list_sanitizer instead." An issue was opened on the Rails Github account (rails/rails#36858) and basically the fix is to update to the latest version of the gem. However, we have reduced the frequency we are getting Dependabot updates and it could be another couple of weeks before this particular update comes through, and therefore thought it would be a good idea to just update it manually so we can stop seeing the deprecation warning.
Steps to reproduce
Call
simple_format
in a view.Expected behavior
No deprecation warnings are raised.
Actual behavior
System configuration
Rails version:
6.0.0RC2
Ruby version:
2.6.3
The text was updated successfully, but these errors were encountered: