diff --git a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php
index 9e4148824ef..c1b3055b444 100644
--- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php
+++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php
@@ -363,7 +363,7 @@ abstract class FileTransfer {
$parts = explode('/', $path);
$chroot = '';
while (count($parts)) {
- $check = implode($parts, '/');
+ $check = implode('/', $parts);
if ($this->isFile($check . '/' . \Drupal::service('file_system')->basename(__FILE__))) {
// Remove the trailing slash.
return substr($chroot, 0, -1);
diff --git a/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php b/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php
index d0937aed51e..5aff4094edc 100644
--- a/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php
+++ b/core/modules/inline_form_errors/tests/src/Unit/FormErrorHandlerTest.php
@@ -138,7 +138,7 @@ class FormErrorHandlerTest extends UnitTestCase {
foreach ($render_array[1]['#items'] as $item) {
$links[] = htmlspecialchars($item['#title']);
}
- return $render_array[0]['#markup'] . '' . implode($links, '') . '';
+ return $render_array[0]['#markup'] . '' . implode('', $links) . '';
}));
$form_state = new FormState();