This won't handle nested hashes.  That may or may not be an issue.  It should be pretty easy to recursively call sanitised here though.