From 05a67386c61c4be699b8a54067b84a72ea004126 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 2 Oct 2024 03:09:43 +0200 Subject: [PATCH] Core: use shlex splitting instead of whitespace splitting for client and server commands (#4011) --- MultiServer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MultiServer.py b/MultiServer.py index c3e377e9..0fe950b5 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -15,6 +15,7 @@ import math import operator import pickle import random +import shlex import threading import time import typing @@ -1152,7 +1153,7 @@ class CommandProcessor(metaclass=CommandMeta): if not raw: return try: - command = raw.split() + command = shlex.split(raw, comments=False) basecommand = command[0] if basecommand[0] == self.marker: method = self.commands.get(basecommand[1:].lower(), None)