mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:49:14 +08:00
FIX: Check parameter types
/u/is_local_username used to throw a 500 error
This commit is contained in:
parent
baca59c1a6
commit
a2f8ac9aac
|
@ -300,8 +300,10 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def is_local_username
|
||||
usernames = params[:usernames]
|
||||
usernames = [params[:username]] if usernames.blank?
|
||||
usernames = params[:usernames] if params[:usernames].present?
|
||||
usernames = [params[:username]] if params[:username].present?
|
||||
|
||||
raise Discourse::InvalidParameters.new(:usernames) if !usernames.kind_of?(Array)
|
||||
|
||||
groups = Group.where(name: usernames).pluck(:name)
|
||||
mentionable_groups =
|
||||
|
|
Loading…
Reference in New Issue
Block a user