Commit b481c949 authored by webchick's avatar webchick

Issue #1884828 by pwolanin: Fixed Replace md5 calls with sha2 in Views in core.

parent fe429cba
......@@ -295,7 +295,7 @@ public function generateResultsKey() {
}
}
$this->resultsKey = $this->view->storage->get('name') . ':' . $this->displayHandler->display['id'] . ':results:' . md5(serialize($key_data));
$this->resultsKey = $this->view->storage->get('name') . ':' . $this->displayHandler->display['id'] . ':results:' . hash('sha256', serialize($key_data));
}
return $this->resultsKey;
......@@ -319,7 +319,7 @@ public function generateOutputKey() {
'base_url' => $GLOBALS['base_url'],
);
$this->outputKey = $this->view->storage->get('name') . ':' . $this->displayHandler->display['id'] . ':output:' . md5(serialize($key_data));
$this->outputKey = $this->view->storage->get('name') . ':' . $this->displayHandler->display['id'] . ':output:' . hash('sha256', serialize($key_data));
}
return $this->outputKey;
......
......@@ -130,7 +130,7 @@ public function initDisplay(ViewExecutable $view, array &$display, array &$optio
// Cache for unpackOptions, but not if we are in the ui.
static $unpack_options = array();
if (empty($view->editing)) {
$cid = 'unpackOptions:' . md5(serialize(array($this->options, $options)));
$cid = 'unpackOptions:' . hash('sha256', serialize(array($this->options, $options)));
if (empty($unpack_options[$cid])) {
$cache = views_cache_get($cid, TRUE);
if (!empty($cache->data)) {
......
......@@ -556,7 +556,7 @@ function render_grouping($records, $groupings = array(), $group_rendered = NULL)
// Not all field handlers return a scalar value,
// e.g. views_handler_field_field.
if (!is_scalar($grouping)) {
$grouping = md5(serialize($grouping));
$grouping = hash('sha256', serialize($grouping));
}
}
}
......
......@@ -1413,7 +1413,7 @@ public function preExecute($args = array()) {
}
// Allow hook_views_pre_view() to set the dom_id, then ensure it is set.
$this->dom_id = !empty($this->dom_id) ? $this->dom_id : md5($this->storage->get('name') . REQUEST_TIME . rand());
$this->dom_id = !empty($this->dom_id) ? $this->dom_id : hash('sha256', $this->storage->get('name') . REQUEST_TIME . mt_rand());
// Allow the display handler to set up for execution
$this->display_handler->preExecute();
......
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