Core: use shlex splitting instead of whitespace splitting for client and server commands (#4011)
This commit is contained in:
		
							parent
							
								
									0ec9039ca6
								
							
						
					
					
						commit
						05a67386c6
					
				| 
						 | 
					@ -15,6 +15,7 @@ import math
 | 
				
			||||||
import operator
 | 
					import operator
 | 
				
			||||||
import pickle
 | 
					import pickle
 | 
				
			||||||
import random
 | 
					import random
 | 
				
			||||||
 | 
					import shlex
 | 
				
			||||||
import threading
 | 
					import threading
 | 
				
			||||||
import time
 | 
					import time
 | 
				
			||||||
import typing
 | 
					import typing
 | 
				
			||||||
| 
						 | 
					@ -1152,7 +1153,7 @@ class CommandProcessor(metaclass=CommandMeta):
 | 
				
			||||||
        if not raw:
 | 
					        if not raw:
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            command = raw.split()
 | 
					            command = shlex.split(raw, comments=False)
 | 
				
			||||||
            basecommand = command[0]
 | 
					            basecommand = command[0]
 | 
				
			||||||
            if basecommand[0] == self.marker:
 | 
					            if basecommand[0] == self.marker:
 | 
				
			||||||
                method = self.commands.get(basecommand[1:].lower(), None)
 | 
					                method = self.commands.get(basecommand[1:].lower(), None)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue