Adds a trim check for admin announcements (#5565)

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
admin: Prevents empty admin announcemnts
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
This commit is contained in:
LordME
2023-06-04 16:47:42 -07:00
committed by GitHub
parent 0f25c58793
commit d9abff771d
+1 -1
View File
@@ -641,7 +641,7 @@ var/global/floorIsLava = 0
if(!check_rights(0)) return
var/message = input("Global message to send:", "Admin Announce", null, null) as message//todo: sanitize for all?
if(message)
if(trim(message))
if(!check_rights(R_SERVER,0))
message = sanitize(message, 500, extra = 0)
message = replacetext(message, "\n", "<br>") // required since we're putting it in a <p> tag