Rails: loss of quotes in message parameters

I am adding full-text search to my Rails site and letting users enter double quotes in the search input field. The problem is that the double quotes seem to be filtered by Mongrel, and so I never get these quotes in the params hash values. How can I prevent this? I am running Rails 2.3.8.

[Edit: added analysis data]

In Firebug, I see that the post parameter is placed correctly with quotes:

search_criteria "great post"

However, there are no quotation marks in the development log:

Processing PostsController # search (for 127.0.0.1 on 2010-06-18 17:28:45) [POST] Parameters: {"search_criteria" => "excellent mail", "action" => "search", "authenticity_token" = > "xUaOc1IAyjQmKn1NGqBpPVaTBmD4ayPq / lUJsqJGCxY =", "Controller" => "messages"}

And when I register the contents and size of the [: search_criteria] parameters in the controller, I get:

search criteria = great post
search criteria size = 10

[Edit: new discovery] This problem described above does not occur when the quoted string is anchored or precedes another character, for example. space.

+3
source share
2 answers

-, 1.1.0. [patch ] 1.2.0. , actionpack (, , ) 2.3.6 2.3.10 ~ > 1.1.0, .

, , , , ...

  • .
  • Rails 3

.

+3

, ; . (Rails 2.3.10).

0

Source: https://habr.com/ru/post/1750687/


All Articles