startsWith('/tmp/') && str($scriptPath)->startsWith('/tmp/') && ! str($tmpPath)->contains('..') && ! str($scriptPath)->contains('..') && strlen($tmpPath) > 5 // longer than just "/tmp/" && strlen($scriptPath) > 5 ) { $commands[] = "docker exec {$container} sh -c 'rm {$scriptPath}'"; $commands[] = "docker exec {$container} sh -c 'rm {$tmpPath}'"; instant_remote_process($commands, Server::find($serverId), throwError: true); } } } }