Skip to content

Commit

Permalink
Fixed broken URI error on categories with ampersands and spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
mager committed Apr 12, 2011
1 parent 1a6cbed commit 5106619
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/simple_geo/client.rb
Expand Up @@ -157,6 +157,9 @@ def get_places(lat, lon, options={})

def get_places_by_address(address, options={})
address = URI.escape(address, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
if (options[:category] != nil)
options[:category] = URI.escape(options[:category], Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
end
geojson_hash = get Endpoint.places_by_address(address, options)
HashUtils.recursively_symbolize_keys geojson_hash
end
Expand Down

0 comments on commit 5106619

Please sign in to comment.