Escape grep_for text when using grep
The rak code already does this and it is necessary for grep as well.
This commit is contained in:
parent
af9b73e2af
commit
93b8e4e9b4
@ -201,7 +201,7 @@ module Rails
|
|||||||
def find_with_grep(text, where)
|
def find_with_grep(text, where)
|
||||||
value = ""
|
value = ""
|
||||||
|
|
||||||
Open3.popen3("grep -r '#{text}' #{where}") do |stdin, stdout, stderr|
|
Open3.popen3("grep -r '#{Regexp.escape(text)}' #{where}") do |stdin, stdout, stderr|
|
||||||
value = stdout.read
|
value = stdout.read
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user