mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-03 16:50:16 +01:00 
			
		
		
		
	[Fix] Fixes escaping issues on remote commands
This commit is contained in:
		
							parent
							
								
									eddb88bcb7
								
							
						
					
					
						commit
						28396c1799
					
				@ -424,8 +424,8 @@ class Runtime
 | 
				
			|||||||
            $cmdDelegate = sprintf('cd %s && %s', $hostPath, $cmdDelegate);
 | 
					            $cmdDelegate = sprintf('cd %s && %s', $hostPath, $cmdDelegate);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $cmdRemote = str_replace(['"', '&', ';', '|'], ['\"', '\&', '\;', '\|'], $cmdDelegate);
 | 
					        $cmdRemote = str_replace('"', '\"', $cmdDelegate);
 | 
				
			||||||
        $cmdLocal = sprintf('ssh -p %d %s %s@%s sh -c \"%s\"', $sshConfig['port'], $sshConfig['flags'], $user, $host, $cmdRemote);
 | 
					        $cmdLocal = sprintf('ssh -p %d %s %s@%s "%s"', $sshConfig['port'], $sshConfig['flags'], $user, $host, $cmdRemote);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $this->runLocalCommand($cmdLocal, $timeout);
 | 
					        return $this->runLocalCommand($cmdLocal, $timeout);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user