Skip to content

Commit

Permalink
Merge pull request #1591 from igigin/255
Browse files Browse the repository at this point in the history
Фикс ÿ в аннаунсах недоадминов без флага SERVER.
  • Loading branch information
volas authored Jun 20, 2017
2 parents eac5f7b + 678cdfe commit 7df4e10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@
/proc/strip_html(t,limit=MAX_MESSAGE_LEN)
return copytext((sanitize(strip_html_simple(t))),1,limit)

//Runs byond's sanitization proc along-side strip_html_simple
//I believe strip_html_simple() is required to run first to prevent '<' from displaying as '&lt;' that html_encode() would cause
/proc/adminscrub(t,limit=MAX_MESSAGE_LEN)
return copytext((html_encode(strip_html_simple(t))),1,limit)


//Returns null if there is any bad text in the string
/proc/reject_bad_text(text, max_length=512)
Expand Down
5 changes: 3 additions & 2 deletions code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,12 @@ var/global/floorIsLava = 0
return

var/message = input("Global message to send:", "Admin Announce", null, null) as message
message = sanitize(message, list("ÿ"=LETTER_255))

if(message)
if(!check_rights(R_SERVER,0))
message = adminscrub(message,500)
message = strip_html(message,500)
else
message = sanitize(message, list("ÿ"=LETTER_255))
to_chat(world, "\blue <b>[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:</b>\n &emsp; [message]")
log_admin("Announce: [key_name(usr)] : [message]")
feedback_add_details("admin_verb","A") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
Expand Down

0 comments on commit 7df4e10

Please sign in to comment.