Skip to content

Commit

Permalink
fixes issue with stderr when there was "]" character. (#48975)
Browse files Browse the repository at this point in the history
* fixes issue with stderr when there was "]" character.

* fixes code style issues

* Update ServeCommand.php

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
nikopeikrishvili and taylorotwell authored Nov 13, 2023
1 parent 0a30702 commit e5a7515
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,13 @@ protected function handleProcessOutput()
} elseif (str($line)->contains(['Closed without sending a request'])) {
// ...
} elseif (! empty($line)) {
$warning = explode('] ', $line);
$this->components->warn(count($warning) > 1 ? $warning[1] : $warning[0]);
$position = strpos($line, '] ');

if ($position !== false) {
$line = substr($line, $position + 1);
}

$this->components->warn($line);
}
});
}
Expand Down

0 comments on commit e5a7515

Please sign in to comment.