From 3312ec5e9b354c148ea27c850f89f645d4604502 Mon Sep 17 00:00:00 2001 From: TA Date: Sun, 11 Apr 2021 19:36:11 +0800 Subject: [PATCH] strip for anonymous status --- app/controllers/api/v1/statuses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 10622eb0a..61cefa290 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -40,7 +40,7 @@ class Api::V1::StatusesController < Api::BaseController def create anon = Rails.configuration.x.anon - anon_name = anon.acc && status_params[:status].end_with?(anon.tag) && generate_anon_name(current_user.account.username + anon.salt + (Time.now - 5.hours).strftime("%D"), anon.namelist, Account.find(anon.acc).note) + anon_name = anon.acc && status_params[:status].strip.end_with?(anon.tag) && generate_anon_name(current_user.account.username + anon.salt + (Time.now - 5.hours).strftime("%D"), anon.namelist, Account.find(anon.acc).note) sender = anon_name ? Account.find(anon.acc) : current_user.account st_text = anon_name ? ("[#{anon_name}]:\n#{status_params[:status]}"[0..5000]) : status_params[:status]