diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php
index 024bf5a..60e1213 100644
--- a/core/lib/Drupal/Core/Database/Install/Tasks.php
+++ b/core/lib/Drupal/Core/Database/Install/Tasks.php
@@ -8,7 +8,6 @@
 namespace Drupal\Core\Database\Install;
 
 use Drupal\Component\Utility\SafeMarkup;
-use Drupal\Component\Utility\String;
 use Drupal\Core\Database\Database;
 
 /**
@@ -148,14 +147,15 @@ public function runTasks() {
         }
       }
     }
-    // Check for failed results and compile message
+    // Check for failed results and compile message.
     $message = '';
     foreach ($this->results as $result => $success) {
       if (!$success) {
-        $message = SafeMarkup::isSafe($result) ? $result : String::checkPlain($result);
+        $message .= $result;
       }
     }
     if (!empty($message)) {
+      $message = SafeMarkup::escape($message);
       $message = SafeMarkup::set('Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="http://drupal.org/getting-started/install">installation handbook</a>, or contact your hosting provider.' . $message);
       throw new TaskException($message);
     }
