Skip to content

Commit

Permalink
Adding < and > to escaped query characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
pat committed Jan 22, 2014
1 parent 2479665 commit 92754f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/riddle/query.rb
Expand Up @@ -99,7 +99,7 @@ def self.translate_value(value)
end

def self.escape(string)
string.gsub(/[\(\)\|\-!@~\/"\/\^\$\\]/) { |match| "\\#{match}" }
string.gsub(/[\(\)\|\-!@~\/"\/\^\$\\><]/) { |match| "\\#{match}" }
end

def self.quote(string)
Expand Down
2 changes: 1 addition & 1 deletion spec/riddle/query_spec.rb
Expand Up @@ -78,7 +78,7 @@
end

describe '.escape' do
%w(( ) | - ! @ ~ / ^ $ ").each do |reserved|
%w(( ) | - ! @ ~ / ^ $ " > <).each do |reserved|
it "escapes #{reserved}" do
Riddle::Query.escape(reserved).should == "\\#{reserved}"
end
Expand Down

0 comments on commit 92754f5

Please sign in to comment.