Send chat error when attemping to /set a secure setting (#12193)

Attempting to /set a secure setting will now say that is disallowed.
Previously this would shut down the server.
Reading secure settings via /set is still allowed.
master
olive 2022-04-16 17:50:36 +01:00 committed by GitHub
parent 1d07a36552
commit 062dd8dabc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -621,6 +621,10 @@ core.register_chatcommand("set", {
setname, setvalue = string.match(param, "([^ ]+) (.+)")
if setname and setvalue then
if setname:sub(1, 7) == "secure." then
return false, S("Failed. Cannot modify secure settings. "
.. "Edit the settings file manually.")
end
if not core.settings:get(setname) then
return false, S("Failed. Use '/set -n <name> <value>' "
.. "to create a new setting.")