rails/rails — pull request #16872 by yuki24 (2014-09-11 04:50:48+00:00)
Title: 'Fix a bug where malformed query strings lead to 500

This is a backport PR of #16871 to `4-0-stable`.