Skip to content

Commit

Permalink
Restrict the allowed characters between the brackets. This is necessa…
Browse files Browse the repository at this point in the history
…ry because it might include nested brackets. (laravel#44908)

"[13804] [Fri Nov 11 16:37:08 2022] [::1]" would resolve into "[Fri Nov 11 16:37:08 2022] [::1"
  • Loading branch information
christoph-kluge committed Nov 21, 2022
1 parent 4598d01 commit 194f2a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ protected function handleProcessOutput()
protected function getDateFromLine($line)
{
$regex = env('PHP_CLI_SERVER_WORKERS', 1) > 1
? '/^\[\d+]\s\[(.*)]/'
? '/^\[\d+]\s\[([a-zA-Z0-9: ]+)\]/'
: '/^\[([^\]]+)\]/';

preg_match($regex, $line, $matches);
Expand Down

0 comments on commit 194f2a5

Please sign in to comment.