lib/prosopite.rb in prosopite-1.0.0 vs lib/prosopite.rb in prosopite-1.0.1
- old
+ new
@@ -19,10 +19,19 @@
tc[:prosopite_query_caller] = {}
@allow_list ||= []
tc[:prosopite_scan] = true
+
+ if block_given?
+ begin
+ yield
+ finish
+ ensure
+ tc[:prosopite_scan] = false
+ end
+ end
end
def tc
Thread.current
end
@@ -103,10 +112,10 @@
query.gsub!(/".*?"/m, "?")
query.gsub!(/'.*?'/m, "?")
query.gsub!(/\btrue\b|\bfalse\b/i, "?")
- query.gsub!(/[0-9+-][0-9a-f.xb+-]*/, "?")
+ query.gsub!(/[0-9+-][0-9a-f.x+-]*/, "?")
query.gsub!(/[xb.+-]\?/, "?")
query.strip!
query.gsub!(/[ \n\t\r\f]+/, " ")
query.downcase!