Fix Rails security vulnerabilities CVE-2014-0081 and CVE-2014-0082

For details, see:

https://groups.google.com/forum/m/#!topic/rubyonrails-security/LMxO_3_eCuc

https://groups.google.com/forum/m/#!topic/rubyonrails-security/tfp6gZCtzr4