Permalink
Browse files

Needs to match the entire username to be considered a match.

Closes #27 and #16
  • Loading branch information...
1 parent cb9bf8b commit 59bb47cdc88bcf36e6cef3c8f33adc2886fc46f5 @wilkie wilkie committed Mar 24, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 models/update.rb
View
@@ -29,7 +29,7 @@ def url=(the_url)
def to_html
out = CGI.escapeHTML(text)
out.gsub!(/(^|\s+)@(\w+)/) do |match|
- if u = User.first(:username => /#{$2}/i)
+ if u = User.first(:username => /^#{$2}$/i)
"#{$1}<a href='/users/#{u.username}'>@#{$2}</a>"
else
match

0 comments on commit 59bb47c

Please sign in to comment.