Skip to content

Commit

Permalink
String replace last occurrence of output
Browse files Browse the repository at this point in the history
Fixes bug where port numbers containing matches got coloured
  • Loading branch information
caendesilva committed Nov 13, 2023
1 parent 7c58d74 commit 3b96bc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/realtime-compiler/src/ConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function formatRequestLine(string $line): string

$statusCode = Str::between($message, ' [', ']:');
if ($statusCode >= 400) {
$message = str_replace($statusCode, sprintf('<span class="text-red-500">%s</span>', $statusCode), $message);
$message = Str::replaceLast($statusCode, sprintf('<span class="text-red-500">%s</span>', $statusCode), $message);
$iconColor = 'yellow-500';
}

Expand Down

0 comments on commit 3b96bc2

Please sign in to comment.