fix unit test fails on Ruby 1.8 and JRuby (#2190)
Fix for Rails vulnerabilities CVE-2012-2694 and CVE-2012-2695.
Merged r9830 from trunk.
Merged r9837 from trunk.
Merged r9836 from trunk.
Merged r9831 from trunk.
Merged r9822 from trunk.
CHANGELOG updated.