mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 05:38:13 +08:00
FIX: sending messages to groups with non-lowercase names
Fixes a regression in e8fb9d406667c758cba0f7b1cc779e1ceb352c4c which caused a bug where you couldn't send a message to a group that contained an Uppercase letter. Added a test case for this. Bug report: https://meta.discourse.org/t/-/152999
This commit is contained in:
@ -748,7 +748,7 @@ class PostsController < ApplicationController
|
||||
|
||||
if recipients
|
||||
recipients = recipients.split(",").map(&:downcase)
|
||||
groups = Group.messageable(current_user).where('lower(name) in (?)', recipients).pluck('name')
|
||||
groups = Group.messageable(current_user).where('lower(name) in (?)', recipients).pluck('lower(name)')
|
||||
recipients -= groups
|
||||
emails = recipients.select { |user| user.match(/@/) }
|
||||
recipients -= emails
|
||||
|
Reference in New Issue
Block a user