mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-30 07:20:09 +00:00
Strip ANSI codes from command output before sending it to the browser
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
@@ -443,6 +443,8 @@ readonly class DockerController {
|
||||
// if it'll actually pull an image), but which should not need to know anything about the
|
||||
// wanted markup or formatting.
|
||||
$addToStreamingResponseBody = function (string $message, ?Container $container = null) use ($nonbufResp) : void {
|
||||
// Strip ANSI codes.
|
||||
$message = preg_replace('/\e[[][A-Za-z0-9];?[0-9]*m?/', '', $message);
|
||||
if ($container) {
|
||||
$message = "{$container->displayName}: {$message}";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user