1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-26 03:01:23 +02:00

Check log messages before interpolate

This commit is contained in:
Barry vd. Heuvel
2021-08-01 11:17:01 +02:00
committed by GitHub
parent 4ef8e359d9
commit b90f9887fb

View File

@@ -185,7 +185,11 @@ class MessagesCollector extends AbstractLogger implements DataCollectorInterface
*/ */
public function log($level, $message, array $context = array()) 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);
} }
/** /**