OSDN Git Service

Shell escape code search
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 31 Oct 2013 09:25:08 +0000 (11:25 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Thu, 31 Oct 2013 09:25:08 +0000 (11:25 +0200)
app/contexts/search_context.rb

index 48def07..ff32297 100644 (file)
@@ -6,7 +6,7 @@ class SearchContext
   end
 
   def execute
-    query = params[:search]
+    query = Shellwords.shellescape(params[:search])
 
     return result unless query.present?