mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
7d09af7eda
This fix ensures that searches that contain a null byte return a 400 error instead of causing a 500 error. For some reason from rspec we will reach the raise statement inside of the `rescue_from ArgumentError` block, but outside of rspec it will not execute the raise statement and so a 500 is thrown instead of reaching the `rescue_from Discourse::InvalidParameters` block inside of the application controller. This fix raises Discourse::InvalidParameters directly from the search controller instead of relying on `PG::Connection.escape_string` to raise the `ArgumentError`.