diff --git a/core/lib/Drupal/Core/Render/PlaceholderGenerator.php b/core/lib/Drupal/Core/Render/PlaceholderGenerator.php index ce0992c..d0e1e7c 100644 --- a/core/lib/Drupal/Core/Render/PlaceholderGenerator.php +++ b/core/lib/Drupal/Core/Render/PlaceholderGenerator.php @@ -7,10 +7,8 @@ namespace Drupal\Core\Render; -use Drupal\Component\Utility\SafeMarkup; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Cache\Cache; -use Drupal\Core\Template\Attribute; /** * Turns a render array into a placeholder. @@ -74,17 +74,16 @@ public function createPlaceholder(array $element) { // Generate placeholder markup. Note that the only requirement is that this // is unique markup that isn't easily guessable. The #lazy_builder callback - // and its arguments are put in the placeholder markup solely to simplify + // and its arguments are put in the placeholder markup solely to simplify<<< // debugging. - $attributes = new Attribute(); - $attributes['callback'] = $placeholder_render_array['#lazy_builder'][0]; - $attributes['arguments'] = UrlHelper::buildQuery($placeholder_render_array['#lazy_builder'][1]); - $attributes['token'] = hash('crc32b', serialize($placeholder_render_array)); - $placeholder_markup = SafeMarkup::format('', ['@attributes' => $attributes]); + $callback = $placeholder_render_array['#lazy_builder'][0]; + $arguments = UrlHelper::buildQuery($placeholder_render_array['#lazy_builder'][1]); + $token = hash('crc32b', serialize($placeholder_render_array)); + $placeholder_markup = ''; // Build the placeholder element to return. $placeholder_element = []; - $placeholder_element['#markup'] = $placeholder_markup; + $placeholder_element['#markup'] = SafeString::create($placeholder_markup); $placeholder_element['#attached']['placeholders'][$placeholder_markup] = $placeholder_render_array; return $placeholder_element; }