Commit 9f127683 authored by alexpott's avatar alexpott
Browse files

Issue #2542830 by borisson_, PieterJanPut, RavindraSingh, Wim Leers, catch:...

Issue #2542830 by borisson_, PieterJanPut, RavindraSingh, Wim Leers, catch: Change placeholder token generation from using sha1 to crc32b
parent 3f0ff219
......@@ -707,7 +707,7 @@ protected function createPlaceholder(array $element) {
$attributes = new Attribute();
$attributes['callback'] = $placeholder_render_array['#lazy_builder'][0];
$attributes['arguments'] = UrlHelper::buildQuery($placeholder_render_array['#lazy_builder'][1]);
$attributes['token'] = hash('sha1', serialize($placeholder_render_array));
$attributes['token'] = hash('crc32b', serialize($placeholder_render_array));
$placeholder_markup = SafeMarkup::format('<drupal-render-placeholder@attributes></drupal-render-placeholder>', ['@attributes' => $attributes]);
// Build the placeholder element to return.
......
......@@ -68,7 +68,7 @@ public function providerPlaceholders() {
if (is_array($cache_keys)) {
$token_render_array['#cache']['keys'] = $cache_keys;
}
$token = hash('sha1', serialize($token_render_array));
$token = hash('crc32b', serialize($token_render_array));
return SafeMarkup::format('<drupal-render-placeholder callback="@callback" arguments="@arguments" token="@token"></drupal-render-placeholder>', [
'@callback' => 'Drupal\Tests\Core\Render\PlaceholdersTest::callback',
'@arguments' => '0=' . $args[0],
......@@ -440,7 +440,7 @@ public function testCacheableParent($test_element, $args, array $expected_placeh
$this->setUpRequest('GET');
$token = hash('sha1', serialize($expected_placeholder_render_array));
$token = hash('crc32b', serialize($expected_placeholder_render_array));
$expected_placeholder_markup = '<drupal-render-placeholder callback="Drupal\Tests\Core\Render\PlaceholdersTest::callback" arguments="0=' . $args[0] . '" token="' . $token . '"></drupal-render-placeholder>';
$this->assertSame($expected_placeholder_markup, Html::normalize($expected_placeholder_markup), 'Placeholder unaltered by Html::normalize() which is used by FilterHtmlCorrector.');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment