mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
Revert "Revert "FEATURE: Can create warnings for users via PM""
This reverts commit 1c7559380c145136726028ae9f2aeea6f351eb78.
This commit is contained in:
@ -331,12 +331,21 @@ class PostsController < ApplicationController
|
||||
permitted << :embed_url
|
||||
end
|
||||
|
||||
|
||||
params.require(:raw)
|
||||
params.permit(*permitted).tap do |whitelisted|
|
||||
whitelisted[:image_sizes] = params[:image_sizes]
|
||||
# TODO this does not feel right, we should name what meta_data is allowed
|
||||
whitelisted[:meta_data] = params[:meta_data]
|
||||
result = params.permit(*permitted).tap do |whitelisted|
|
||||
whitelisted[:image_sizes] = params[:image_sizes]
|
||||
# TODO this does not feel right, we should name what meta_data is allowed
|
||||
whitelisted[:meta_data] = params[:meta_data]
|
||||
end
|
||||
|
||||
# Staff are allowed to pass `is_warning`
|
||||
if current_user.staff?
|
||||
params.permit(:is_warning)
|
||||
result[:is_warning] = (params[:is_warning] == "true")
|
||||
end
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
def too_late_to(action, post)
|
||||
|
Reference in New Issue
Block a user