Per Drupal secure coding standards at http://drupal.org/node/845876

md5 and sha1 should not be used any place in Drupal core since 7.0, but are re-introduced in the Block module for 8.x:

core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php
197:      $old_delta = md5($old_delta);
201:      $md5_delta = md5($delta);
202:      $hashes[$md5_delta] = $delta;
203:      $delta = $md5_delta;
CommentFileSizeAuthor
#4 drupal-1884826-4.patch1.87 KBdawehner
#1 1884826-1.patch1012 bytespwolanin
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

Component: block.module » views.module
Status: Active » Needs review
FileSize
1012 bytes

Looks like this is also related to views in core, actually.

pwolanin’s picture

Assigned: Unassigned » pwolanin
tim.plunkett’s picture

Component: views.module » block.module
Issue tags: +VDC

The code is in block module now. Tagging for VDC.

dawehner’s picture

FileSize
1.87 KB

A much simpler approach :P ... we don't have the block table anymore and so no need for these damn delta hashes.

olli’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Yay less code. :D

Committed and pushed to 8.x. Thanks!

pwolanin’s picture

Needs backport to views 7.x of the original fix?

pwolanin’s picture

If backported to 7.x and a hash is needed, here is a better hash scheme (more bits used):

$hash = substr(drupal_hash_base64($delta), 0, 32);

Which we use in facetapi for block deltas:
http://drupalcode.org/project/facetapi.git/blob/refs/heads/7.x-1.x:/face...

dawehner’s picture

What about just using a single place in views, as the code is in the same module.

Automatically closed -- issue fixed for 2 weeks with no activity.