mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge pull request #1379 from 12pm/pr_auth_username_quote_semicolon
Fix output for usernames with double quotes and semicolons
This commit is contained in:
commit
5348533858
|
@ -21,7 +21,8 @@ def auth_add_p_line(username, level, pwhash, salt):
|
|||
print("Warning: level ({}) contains weird symbols, config line is possibly malformed.".format(level), file=sys.stderr)
|
||||
if repr(username) != "'{}'".format(username):
|
||||
print("Warning: username ({}) contains weird symbols, config line is possibly malformed.".format(username), file=sys.stderr)
|
||||
if ' ' in username:
|
||||
username = username.replace('"', '\\"')
|
||||
if ' ' in username or ';' in username:
|
||||
username = '"{}"'.format(username)
|
||||
return "auth_add_p {} {} {} {}".format(username, level, pwhash, salt)
|
||||
|
||||
|
|
Loading…
Reference in a new issue