noosfero | WIP: Rails 5.1.6 Upgrade (!1438)

Gabriel Silva gitlab at mg.gitlab.com
Wed Oct 31 12:14:34 BRST 2018


Gabriel Silva started a new discussion on app/helpers/sanitize_helper.rb:

>    end
>  
>    def sanitizer type = :full_sanitize
> -    return HTML::WhiteListSanitizer.new if type == :white_list
> -    HTML::FullSanitizer.new
> +    white_list_sanitizer = Rails::Html::WhiteListSanitizer.new
> +    return white_list_sanitizer if type == :white_list
> +    full_sanitizer = Rails::Html::FullSanitizer.new
> +    full_sanitizer

Looks like there is no reason for these assignments. Why can't we use the old code? Is this a matter of code style? Why not the following:

```ruby
if type == :white_list
  Rails::Html::WhiteListSanitizer.new
else
  Rails::Html::FullSanitizer.new
end
```

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/noosfero/noosfero/merge_requests/1438#note_113517285
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20181031/6b2f1a09/attachment-0001.html>


More information about the Noosfero-dev mailing list