Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / dblog / src / Logger / DbLog.php
index 97b0b7b3059c92fa3b5278bb583130bf2872b9bb..5933e222810c35c183d20cbf45ba1b93a9d3776a 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\dblog\Logger;
 
-use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\DatabaseException;
@@ -57,8 +56,8 @@ class DbLog implements LoggerInterface {
     // Remove any backtraces since they may contain an unserializable variable.
     unset($context['backtrace']);
 
-    // Convert PSR3-style messages to SafeMarkup::format() style, so they can be
-    // translated too in runtime.
+    // Convert PSR3-style messages to \Drupal\Component\Render\FormattableMarkup
+    // style, so they can be translated too in runtime.
     $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context);
 
     try {
@@ -66,14 +65,14 @@ class DbLog implements LoggerInterface {
         ->insert('watchdog')
         ->fields([
           'uid' => $context['uid'],
-          'type' => Unicode::substr($context['channel'], 0, 64),
+          'type' => mb_substr($context['channel'], 0, 64),
           'message' => $message,
           'variables' => serialize($message_placeholders),
           'severity' => $level,
           'link' => $context['link'],
           'location' => $context['request_uri'],
           'referer' => $context['referer'],
-          'hostname' => Unicode::substr($context['ip'], 0, 128),
+          'hostname' => mb_substr($context['ip'], 0, 128),
           'timestamp' => $context['timestamp'],
         ])
         ->execute();