Skip to content

Commit

Permalink
Check log messages before interpolate (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Aug 1, 2021
1 parent 4ef8e35 commit 0a35325
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DebugBar/DataCollector/MessagesCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ public function getMessages()
*/
public function log($level, $message, array $context = array())
{
$this->addMessage($this->interpolate($message, $context), $level);
// For string messages, interpolate the context following PSR-3
if (is_string($message)) {
$message = $this->interpolate($message, $context);
}
$this->addMessage($message, $level);
}

/**
Expand Down

0 comments on commit 0a35325

Please sign in to comment.