diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 4856f5af32..ab0b0d933a 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -113,12 +113,6 @@ to_chat(src, "Error: Use the admin IRC/Discord channel, nerd.", confidential = TRUE) return - //clean the message if it's not sent by a high-rank admin - if(!check_rights(R_SERVER|R_DEBUG,0)||external)//no sending html to the poor bots - msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN)) - if(!msg) - return - else //get message text, limit it's length.and clean/escape html if(!msg) @@ -133,11 +127,16 @@ else if(holder) to_chat(src, "Error: Admin-PM: Client not found.", confidential = TRUE) - to_chat(src, "Message not sent:
[msg]", confidential = TRUE) + to_chat(src, "Message not sent:
[sanitize(msg)]", confidential = TRUE) if(recipient_ticket) recipient_ticket.AddInteraction("No client found, message not sent:
[msg]") return else + //clean the message if it's not sent by a high-rank admin + if(!check_rights(R_SERVER|R_DEBUG,0)||external)//no sending html to the poor bots + msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN)) + if(!msg) + return current_ticket.MessageNoRecipient(msg) return @@ -149,6 +148,12 @@ if(src.handle_spam_prevention(msg,MUTE_ADMINHELP)) return + //clean the message if it's not sent by a high-rank admin + if(!check_rights(R_SERVER|R_DEBUG,0)||external)//no sending html to the poor bots + msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN)) + if(!msg) + return + var/rawmsg = msg if(holder)