2
0
mirror of https://github.com/moebooru/moebooru synced 2025-08-31 05:55:11 +00:00

r1807 favtags fixes

--HG--
branch : moe
extra : convert_revision : svn%3A2d28d66d-8d94-df11-8c86-00306ef368cb/trunk/moe%40134
This commit is contained in:
petopeto
2010-09-07 02:56:32 +00:00
parent c2e065fde8
commit 74c1ec19fd
2 changed files with 12 additions and 4 deletions

View File

@@ -96,11 +96,11 @@ module PostSqlMethods
if q[:favtag].is_a?(String)
user = User.find_by_name(q[:favtag])
q[:favtag] =~ /^(.+?):(.+)$/
username = $1
username = $1 || q[:favtag]
favtag_name = $2
user = User.find_by_name(username)
if user && favtag_name
if user
post_ids = FavoriteTag.find_post_ids(user.id, favtag_name)
conds << "p.id IN (?)"
cond_params << post_ids