rgrove/sanitize — pull request #75 by pda (2013-06-25 13:03:03+00:00)
Title: Configs deeply frozen to prevent accidental/malicious alteration.

The build-in configurations should be frozen to prevent accidental or
malicious alteration.

For example the following code probably works, and at a glance is cloning the
RESTRICTED config before customizing it, but has very bad side effects for
other users of `Sanitize::Config::RESTRICTED` in the same process:

```ruby
def my_config
Sanitize::Config::RESTRICTED.dup.tap do |config|
config[:elements].push("script")
end
end
```

If the `.freeze` everywhere is too verbose, a helper could be introduced
similar to the `assert_deep_frozen()` method in `test/test_sanitize.rb`.

Thoughts?