Skip to content

Commit 0a35325

Browse files
authored
Check log messages before interpolate (php-debugbar#477)
1 parent 4ef8e35 commit 0a35325

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DebugBar/DataCollector/MessagesCollector.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ public function getMessages()
185185
*/
186186
public function log($level, $message, array $context = array())
187187
{
188-
$this->addMessage($this->interpolate($message, $context), $level);
188+
// For string messages, interpolate the context following PSR-3
189+
if (is_string($message)) {
190+
$message = $this->interpolate($message, $context);
191+
}
192+
$this->addMessage($message, $level);
189193
}
190194

191195
/**

0 commit comments

Comments
 (0)