Skip to content

Commit

Permalink
Fixing redirect for slug -> username change.
Browse files Browse the repository at this point in the history
  • Loading branch information
LindseyB committed Mar 29, 2011
1 parent addf911 commit 8bc7bf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ class Rstatus
user = User.first :username => params[:username]
if user.nil?
#check for a case insensitive match and then redirect to the correct address
slug = Regexp.escape(params[:slug])
user = User.first("$where" => "this.username.match(/#{slug}/i)")
username = Regexp.escape(params[:username])
user = User.first("$where" => "this.username.match(/#{username}/i)")
if user.nil?
raise Sinatra::NotFound
else
Expand Down

0 comments on commit 8bc7bf0

Please sign in to comment.