Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Update comment by cleaning code
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitche committed Aug 2, 2012
1 parent 5e3dccd commit 7cf4926
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion r2/r2/controllers/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,10 @@ def GET_search(self, query, num, reverse, after, count, sort, restrict_sr,
reverse=reverse,
count=count)
except InvalidQuery:
# strip the query down to a whitelist
# Clean the search of characters that might be causing the
# InvalidQuery exception. If the cleaned search boils down
# to an empty string, the search code is expected to bail
# out early with an empty result set.
cleaned = re.sub("[^\w\s]+", " ", query)
cleaned = cleaned.lower().strip()

Expand Down

0 comments on commit 7cf4926

Please sign in to comment.