diff --git a/core/lib/Drupal/Core/Logger/LoggerBase.php b/core/lib/Drupal/Core/Logger/LoggerBase.php index 77f0190..ddac7b4 100644 --- a/core/lib/Drupal/Core/Logger/LoggerBase.php +++ b/core/lib/Drupal/Core/Logger/LoggerBase.php @@ -34,7 +34,7 @@ protected function parseMessagePlaceholders(&$message, array &$context) { $variables = array(); $has_ps3 = FALSE; - if (strpos($message, '{') !== FALSE && strpos($message, '}') > 1) { + if (($start = strpos($message, '{')) !== FALSE && strpos($message, '}') > $start) { $has_ps3 = TRUE; // Replace PS3 messages containing placeholders. $message = preg_replace('/\{(.*)\}/', '@$1', $message); diff --git a/core/tests/Drupal/Tests/Core/Logger/LoggerBaseTest.php b/core/tests/Drupal/Tests/Core/Logger/LoggerBaseTest.php index 4ad7e56..54cd479 100644 --- a/core/tests/Drupal/Tests/Core/Logger/LoggerBaseTest.php +++ b/core/tests/Drupal/Tests/Core/Logger/LoggerBaseTest.php @@ -75,6 +75,11 @@ public function providerTestParseMessagePlaceholders() { array('message' => 'User @username created', 'context' => array('@username' => 'Dries')), array('message' => 'User @username created', 'context' => array('@username' => 'Dries')), ), + // Messsage without placeholders but wildcard characters. + array( + array('message' => 'User W-\\};~{&! created @', 'context' => array('' => '')), + array('message' => 'User W-\\};~{&! created @', 'context' => array()), + ), ); }